Bug in the optimizer.
Laurent Michel
ldm@cs.brown.edu
Wed Dec 17 11:21:00 GMT 1997
Here is a simple piece of code that compiles fine in debug mode bug
crashes the compiler in -O6. Of course, this works fine with sun's
compiler.
My machine is:
mothra /u/ldm/finite/ver0.7 [192] -> uname -a
SunOS mothra 5.5.1 Generic_103640-09 sun4u sparc SUNW,Ultra-Enterprise
mothra /u/ldm/finite/ver0.7 [193] -> eg++ -v
Reading specs from /cs/lib/egcs-lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.90.21/specs
gcc version egcs-2.90.21 971202 (egcs-1.00 release)
mothra /u/ldm/finite/ver0.7 [200] -> eg++ -O6 bug.C
bug.C: In function `int main()':
bug.C:17: Internal compiler error.
bug.C:17: Please submit a full bug report to `egcs-bugs@cygnus.com'.
mothra /u/ldm/finite/ver0.7 [204] -> eg++ -g bug.C
mothra /u/ldm/finite/ver0.7 [205] ->
and here is the source code!
NB/ As soon as you take the union out, it works.... It also breaks
with other binary operators. It breaks at any level (O1 -> O6).
Let me know!
Thanks,
---
Laurent.
int main()
{
union {
unsigned long tot;
unsigned short law[2];
};
law[0] = law[0] ^ law[1];
return 1;
}
More information about the Gcc-bugs
mailing list