From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26541 invoked by alias); 28 Oct 2011 07:34:59 -0000 Received: (qmail 26169 invoked by uid 22791); 28 Oct 2011 07:34:58 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_DR,TW_TV,TW_VF 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, 28 Oct 2011 07:34:45 +0000 From: "sebastian.huber@embedded-brains.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/38644] [4.4/4.5/4.6/4.7 Regression] Optimization flag -O1 -fschedule-insns2 causes wrong code Date: Fri, 28 Oct 2011 07:34:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: sebastian.huber@embedded-brains.de X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.4.7 X-Bugzilla-Changed-Fields: 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 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-10/txt/msg02954.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38644 --- Comment #54 from Sebastian Huber 2011-10-28 07:31:19 UTC --- I tested with GCC 4.6.2 and the patch provided by Mikael Pettersson. It works for -march=armv4t and -march=armv5t, but not for -march=armv5te: --- test-armv5te.s 2011-10-28 09:22:24.627388063 +0200 +++ test-armv5t.s 2011-10-28 09:22:19.923643155 +0200 @@ -1,4 +1,4 @@ - .arch armv5te + .arch armv5t .fpu softvfp .eabi_attribute 20, 1 .eabi_attribute 21, 1 @@ -27,8 +27,8 @@ mov r1, r4 mov r2, #1 bl doStreamReadBlock - add sp, sp, #8 ldrb r0, [r4] + add sp, sp, #8 @ sp needed for prologue pop {r4, pc} .size readStream, .-readStream Command line: arm-eabi-gcc -O2 -march=armv5t -mthumb -S test.c -o test-armv5t.s arm-eabi-gcc -O2 -march=armv5te -mthumb -S test.c -o test-armv5te.s