http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48990
Summary: MIPS wrong code error with -O1
Product: gcc
Version: 4.5.3
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: target
AssignedTo: [email protected]
ReportedBy: [email protected]
Created attachment 24241
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24241
preprocessed file (trimmed a bit) that reproduces the bug
The attached file compiles wrong code with -march=xlr -msoft-float -mabi=n32
-O1. It compiles correctly with -O2.
The error shows up in basic block 3: the branch (beql $2,$0,$L10) has a li
$4,32 in its delay slot. That clobbers $4 (A0) in the no-branch case, and A0
is still needed a few lines below.
The bug is also present in GCC 4.5.1
In looking at the debug dumps, I see the problem introduced in the "mach" pass
-- that pass builds a sequence insn for the branch and the load.
I'll try 4.6.0 next.