I really had a hard time tracking this down from a large program: gcc 4.0.2 on i386-linux sometimes passes wrong arguments.
Please try the attached source file on i386 with "gcc-4.0.2 -march=i386 -O3 -fomit-frame-pointer". When looking at the disassembly of f2() it seems that %edi is incorrectly used twice: 5e: 89 f8 mov %edi,%eax !!!!! 60: ff 74 24 24 pushl 0x24(%esp) 64: 55 push %ebp 65: 89 f9 mov %edi,%ecx !!!!! 67: 89 da mov %ebx,%edx 69: e8 92 ff ff ff call 0 <f1> This wrong-code bug is probably a 3.2, 3.3 and 3.4 regression. ~Markus -- Summary: i386: wrong arguments passed Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: markus at oberhumer dot com GCC host triplet: i386-pc-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25196