This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
GCC generates incorrect code when optimising
- To: <gcc-bugs at gcc dot gnu dot org>
- Subject: GCC generates incorrect code when optimising
- From: "Richard Mitton" <richard dot mitton at bigfoot dot com>
- Date: Wed, 16 Aug 2000 01:58:44 +0100
Attached is a file demonstrating this.
I've tried to simplify this as much as possible. As far as I can tell, it's
a compiler bug and not something wrong with my program.
The first command in main() should read a value from a function, add 1, and
print it. This should always result in 11 as the function always returns 10.
But if -O and -fomit-frame-pointer are enabled, it throws away the return
value and prints an incorrect answer.
The annoying thing is, there's some other code after this bit that
technically should have no effect, but if I remove it the bug goes away...
Any ideas guys? :-|
-----------------------------------------------
Richard Mitton,
richard.mitton@bigfoot.com
-----------------------------------------------
test.c