From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7606 invoked by alias); 30 Dec 2009 00:08:54 -0000 Received: (qmail 7576 invoked by uid 48); 30 Dec 2009 00:08:42 -0000 Date: Wed, 30 Dec 2009 00:08:00 -0000 Message-ID: <20091230000842.7575.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/42500] unnecessary register move In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ramana at gcc dot gnu dot org" 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: 2009-12/txt/msg02734.txt.bz2 ------- Comment #1 from ramana at gcc dot gnu dot org 2009-12-30 00:08 ------- What architecture options are you using ? With .ident "GCC: (GNU) 4.5.0 20091229 (experimental)" and -O2 I get the redundant move into r4 of sp . But for -Os I get the following very different code. I don't see the call to memset ever. .text .align 2 .global foo .type foo, %function foo: @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 stmfd sp!, {r0, r1, r2, lr} @, mov r3, r0 @ a, a ldr r2, [r0, #12] @ tmp142, str r2, [sp, #0] @ tmp142, ldr r0, .L2 @, ldmia r3, {r1, r2, r3} @ phole ldm bl printf @ ldmfd sp!, {r1, r2, r3, pc} .L3: .align 2 .L2: .word .LC0 .size foo, .-foo .section .rodata.str1.1,"aMS",%progbits,1 .LC0: .ascii "%d %d %d %d \012\000" .ident "GCC: (GNU) 4.5.0 20091229 (experimental)" .section .note.GNU-stack,"",%progbits -- ramana at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|unnecessary register move |unnecessary register move http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42500