From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29300 invoked by alias); 11 Jan 2010 06:47:12 -0000 Received: (qmail 29184 invoked by uid 48); 11 Jan 2010 06:47:00 -0000 Date: Mon, 11 Jan 2010 06:47:00 -0000 Message-ID: <20100111064700.29183.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/40730] redundant memory load In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "carrot at google dot com" 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: 2010-01/txt/msg01197.txt.bz2 ------- Comment #10 from carrot at google dot com 2010-01-11 06:47 ------- (In reply to comment #9) > With "GCC: (GNU) 4.5.0 20100108 (experimental) [trunk revision 155731]" and my > patch for bug 20070 applied, I get the following code: > > iterate: > push {lr} > ldr r3, [r1] > .L6: > str r3, [r0] > sub r2, r3, #0 > bne .L5 > b .L3 > .L4: > ldr r3, [r3, #8] > b .L6 > .L5: > ldr r1, [r3, #4] > cmp r1, #0 > beq .L4 > .L3: > str r2, [r0, #12] > @ sp needed for prologue > pop {pc} > > Carrot, could you please double-check that this is still correct code? > Yes, it is correct. There are still 13 instructions, I think it is related to unoptimized basic block order. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40730