This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/13877] New: [3.3 regression] miscompilation with -O -funroll-loops on powerpc


[forwarded from http://bugs.debian.org/229567]

seen with 3.3 CVS 20040110, not in 3.2.3 and 3.4 CVS.

When complied with -O -funroll-loops on powerpc, the attached test.i 
produces the following output: 
 
Bytes in main:  0 1 
Bytes in: 0 1 0 1 0 1 ( 0 10 15 254) 
x = 282 
Bytes in: 0 1 0 1 0 1 ( 94 52 15 254) 
x = 418 
Bytes in: 0 1 0 1 0 1 ( 7 208 15 254) 
x = 487 
 
The reported x's should be the sum of the first six numbers on the line 
above. Instead, it is the sum of _all_ the numbers on the line above. 
Changing -O to -O2, or removing -funroll-loops generates the following 
(correct) result: 

Bytes in main:  0 1 
Bytes in: 0 1 0 1 0 1 ( 70 148 15 234) 
x = 3 
Bytes in: 0 1 0 1 0 1 ( 0 10 15 254) 
x = 3 
Bytes in: 0 1 0 1 0 1 ( 7 76 15 234) 
x = 3 
 
On 386, this problem does not occur. 
 
Note that this could be the same bug as PR13222, in which case this would 
be a nice, small, test case. I have not actually looked at the test case 
in PR13222 however, since it is rather large. 
 
Flags used: 
  gcc -O -funroll-loops test.i

-- 
           Summary: [3.3 regression] miscompilation with -O -funroll-loops
                    on powerpc
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: debian-gcc at lists dot debian dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-linux
  GCC host triplet: powerpc-linux
GCC target triplet: powerpc-linux


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]