[Bug c/56089] New: Instruction Scheduling error

2013-01-23 Thread nicolas.valot at gmail dot com


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)


[Bug c/56089] Instruction Scheduling error

2013-01-23 Thread nicolas.valot at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56089



nicolas  changed:



   What|Removed |Added



 Target||powerpc

   Host||X86



--- Comment #1 from nicolas  2013-01-23 
21:17:46 UTC ---

Bug only appears with -O2, and disapears when a printf call uses input

parameter A & B.