http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56089
Bug #: 56089 Summary: Instruction Scheduling error Classification: Unclassified Product: gcc Version: 3.3.2 Status: UNCONFIRMED Severity: critical Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: nicolas.va...@gmail.com Created attachment 29261 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29261 source, object and output of objdump -S Instruction lwz at offset 8 restores float A parameter from stack before it has been stored at offset 14 Same for lwz at offset C restores float B parameter from stack before it has been stored at offset 18 int almostEqual(float A, float B, int maxDiff) { 0: 94 21 ff f0 stwu r1,-16(r1) void *aAddr = &A; /* needed to avoid breaking compiler strict-aliasing rules */ int aInt = *(int*)aAddr; 4: 39 40 00 01 li r10,1 8: 81 61 00 08 lwz r11,8(r1) void *bAddr = &B; int bInt = *(int*)bAddr; c: 81 21 00 0c lwz r9,12(r1) // Make aInt lexicographically ordered as a twos-complement int if (aInt < 0) 10: 2f 8b 00 00 cmpwi cr7,r11,0 14: d0 21 00 08 stfs f1,8(r1) 18: d0 41 00 0c stfs f2,12(r1)