From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4 Description of problem: The output from the compiler is broken with '-O2' optimisation turned on. After two levels of function calls, the arguments to the final function are the same when they should be different. Here is a simple program that reproduces the problem: struct number { int value; int only_here_to_cause_a_bug_1; int only_here_to_cause_a_bug_2; }; int different(struct number a, struct number b); int still_different(struct number a, struct number b); int main(int argc, char **argv) { struct number three, seven; three.value = 3; seven.value = 7; return ! different(three, seven); } int different(struct number a, struct number b) { return still_different(b, a); } int still_different(struct number a, struct number b) { return (a.value != b.value); } Version-Release number of selected component (if applicable): gcc-4.0.0-8 How reproducible: Always Steps to Reproduce: 1.Save the above program in a file try.c 2.Run '/usr/bin/gcc -O2 try.c' 3.Run './a.out' Actual Results: The program exits with an error status Expected Results: It should exit without an error status. Additional info: Removing the unused fields from the structure removes the problem. Reducing the optimisation removes the problem. Reversing the order of the arguments in the call to the function "still_different" removes the problem.
http://gcc.gnu.org/ml/gcc-patches/2005-07/msg00941.html
Should be fixed in gcc-4.0.1-4 (rawhide) and gcc-4.0.1-3.fc4 (FC4 testing update).