Faulty compilation of do ... while loop
|
|
Bugzilla Link |
16 |
Created on |
Jun 15, 2003 16:55 |
Resolution |
LATER |
Resolved on |
Jun 17, 2003 13:44 |
Version |
1.00beta |
OS |
Linux |
Architecture |
PC |
Attachments |
tutu_dw, attachment
|
Extended Description
The following lines crashed the compiler in pde1.sac during the last masterrun:
import Array:all;
int main()
{
h = 1d;
f = [0d];
z=0d;
nrel=1;
#if 0
while (nrel <= 10) {
u = h * f;
z += u[0];
nrel++;
}
#else
do {
u = h * f;
z += u[0];
nrel++;
}
while( nrel<=10);
#endif
return(nrel);
}
When compiling with -ssa -nocf the compiler crashes during AssociativeLaw
because of an invalid AVIS_SSAASSIGN reference for the h in line u = h * f;.
I believe that this is not a bug in AssociativeLaw, but that the invalid
reference is introduced before AL. Most likely in LIR because with -nolir the
error does not occur.
However, an important observation is that the compiler only crashes if the loop
is a do ... while loop. The variant using the while-loop doesn't cause any trouble.