Strange bug in egcs-1.1.2 suspected
Martin v. Loewis
martin@mira.isdn.cs.tu-berlin.de
Wed Jun 30 15:43:00 GMT 1999
> pommnitz ~/alias>gcc -O2 aliasorig.c -o aliasorig
> pommnitz ~/alias>./aliasorig
> 0x12
This looks like a bug to me. gcc-2.95 19990614 says
mira% gcc -o a -O2 a.c
mira% ./a
0x78563412
If you look at the generated assembly code, you'll find that all the
assignments are optimized-aways, and that the compiler *just knows*
that the result is 18 - which, of course, is wrong.
You'll probably find that people don't care that much about egcs 1.1
bugs, anymore, now that gcc 2.95 is soon to be released.
Regards,
Martin
More information about the Gcc
mailing list