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 stwur1,-16(r1)
void *aAddr = &A; /* needed to avoid breaking compiler strict-aliasing
rules */
int aInt = *(int*)aAddr;
4:39 40 00 01 lir10,1
8:81 61 00 08 lwzr11,8(r1)
void *bAddr = &B;
int bInt = *(int*)bAddr;
c:81 21 00 0c lwzr9,12(r1)
// Make aInt lexicographically ordered as a twos-complement int
if (aInt < 0)
10:2f 8b 00 00 cmpwicr7,r11,0
14:d0 21 00 08 stfsf1,8(r1)
18:d0 41 00 0c stfsf2,12(r1)