This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/39839] [4.3/4.4/4.5 regression] loop invariant motion causes stack spill
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jan 2010 00:49:56 -0000
- Subject: [Bug tree-optimization/39839] [4.3/4.4/4.5 regression] loop invariant motion causes stack spill
- References: <bug-39839-17592@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from steven at gcc dot gnu dot org 2010-01-02 00:49 -------
With "GCC: (GNU) 4.5.0 20090808 (experimental) [trunk revision 150579]" I get:
.arch armv5te
.fpu softvfp
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 1
.eabi_attribute 30, 4
.eabi_attribute 18, 4
.code 16
.file "t.c"
.text
.align 1
.global test
.code 16
.thumb_func
.type test, %function
test:
push {r3, r4, r5, r6, r7, lr}
ldr r3, .L7
ldr r5, .L7+4
.LPIC0:
add r3, pc
add r5, r3, r5
mov r7, r5
mov r4, r0
ldr r6, [r0]
add r7, r7, #8
b .L2
.L4:
ldr r1, [r4, #4]
ldrb r3, [r1]
cmp r3, #0
bne .L5
mov r3, r5
b .L3
.L5:
add r3, r5, #4
.L3:
add r1, r1, r6
mov r0, r7
mov r2, r6
bl func
ldr r3, [r4]
sub r3, r3, #1
str r3, [r4]
.L2:
ldr r3, [r4]
cmp r3, #0
bge .L4
@ sp needed for prologue
pop {r3, r4, r5, r6, r7, pc}
.L8:
.align 2
.L7:
.word _GLOBAL_OFFSET_TABLE_-(.LPIC0+4)
.word .LANCHOR0(GOTOFF)
.size test, .-test
.section .rodata
.set .LANCHOR0,. + 0
.LC0:
.ascii "xyz\000"
.LC1:
.ascii "pqr\000"
.LC2:
.ascii "abcde\000"
.ident "GCC: (GNU) 4.5.0 20090808 (experimental) [trunk revision
150579]"
I have no idea whether that is better or worse. Alexander, could you give this
a look please?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39839