[Bug target/42500] unnecessary register move
--- Comment #3 from carrot at google dot com 2009-12-30 06:46 --- My complete command line: "/home/carrot/compiler/armobj/gcc/cc1plus" "-fpreprocessed" "testH.ii" "-quiet" "-dumpbase" "testH.cpp" "-auxbase-strip" "obj/./testH.o" "-Os" "-o" "testH.s" Please compile it as C++ program. When I compiled it as C program, I got the same result as yours. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42500
[Bug target/42500] unnecessary register move
--- Comment #2 from ramana at gcc dot gnu dot org 2009-12-30 00:10 --- (In reply to comment #1) > 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. \ Sorry I meant this rather than the code in comment #1 bar: @ args = 0, pretend = 0, frame = 16 @ frame_needed = 0, uses_anonymous_args = 0 stmfd sp!, {r0, r1, r2, r3, r4, lr} str r0, [sp, #0] mov r0, sp stmib sp, {r1, r2, r3}@ phole stm bl foo mov r0, sp mov r4, sp bl foo ldmfd sp!, {r0, r1, r2, r3, r4, pc} .size bar, .-bar .ident "GCC: (GNU) 4.5.0 20091229 (experimental)" .section.note.GNU-stack,"",%progbits -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42500
[Bug target/42500] unnecessary register move
--- 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