As mentioned in PR 42334, 200.sixtrack from SPEC CPU2000 started getting wrong answers on powerpc64-linux with the Graphite merge at r140301 when compiled with "-O2 -floop-interchange -ftree-loop-distribution". The loop that is miscompiled is:
real*8 rt(6,6),r(6,6),rtt(6,6) do i=1,6 do j=1,6 do ia=1,6 rtt(i,ia)=rt(i,j)*r(j,ia)+rtt(i,ia) end do end do end do I'll attach a complete executable testcase that demonstrates the failure. This testcase, and 200.sixtrack, pass when compiled with these options with GCC 4.4.2 and with trunk r150248 (the last trunk revision before r150301 that builds on powerpc64-linux). -- Summary: wrong code for -floop-interchange -ftree-loop- distribution Product: gcc Version: 4.5.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: janis at gcc dot gnu dot org GCC target triplet: powerpc64-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42637