From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16332 invoked by alias); 13 May 2011 16:12:10 -0000 Received: (qmail 16322 invoked by uid 22791); 13 May 2011 16:12:08 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 May 2011 16:11:55 +0000 From: "pkoning at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/48990] New: MIPS wrong code error with -O1 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: pkoning at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Fri, 13 May 2011 16:15:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg01109.txt.bz2 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: unassigned@gcc.gnu.org ReportedBy: pkoning@gcc.gnu.org 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.