From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5127 invoked by alias); 13 Mar 2011 15:09:57 -0000 Received: (qmail 5118 invoked by uid 22791); 13 Mar 2011 15:09:56 -0000 X-SWARE-Spam-Status: No, hits=-2.8 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; Sun, 13 Mar 2011 15:09:52 +0000 From: "mikpe at it dot uu.se" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/48090] gcc 4.5.2 miscompilation when building on arm X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mikpe at it dot uu.se 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: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sun, 13 Mar 2011 15:09: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-03/txt/msg01320.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48090 Mikael Pettersson changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rearnsha at gcc dot gnu.org --- Comment #7 from Mikael Pettersson 2011-03-13 15:09:36 UTC --- The miscompilation on 4.5 branch started with r154181, the PR42031 fix; see . On the standalone test case, r154181 changed the -march=armv5t -O2 code as follows: --- pr48090.s-r154180 2011-03-13 15:39:16.000000000 +0100 +++ pr48090.s-r154181 2011-03-13 15:43:21.000000000 +0100 @@ -81,11 +81,9 @@ mov r6, r1 bl seek_archive cmp r1, #0 - mov r3, r0 - mov r4, r1 blt .L14 - rsbs r1, r3, #0 - rsc r2, r4, #0 + rsbs r1, r0, #0 + rsc r2, r1, #0 mov r4, r2, asl #9 mov r3, r1, asl #9 orr r4, r4, r1, lsr #23 which breaks the second 'rsc' insn since it now reads the updated r1 value instead of the original one.