This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/50106] [ARM] Wrong code with -march=armv5t -mthumb -Os
- From: "sebastian dot huber at embedded-brains dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 22 Aug 2011 09:43:39 +0000
- Subject: [Bug target/50106] [ARM] Wrong code with -march=armv5t -mthumb -Os
- Auto-submitted: auto-generated
- References: <bug-50106-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50106
--- Comment #4 from Sebastian Huber <sebastian.huber@embedded-brains.de> 2011-08-22 09:43:39 UTC ---
Yes, this patch fixes the problem.
It is still not clear to me why we save the volatile registers r0, r1, and r2
at all. Also we restore r1, r2, and r3. Does this make sense? I think also
the the usage of memcpy() is not justified in this case.
_Z7_GetIDSj:
.fnstart
.LFB0:
.save {r0, r1, r2, lr}
push {r0, r1, r2, lr}
ldr r1, .L4
cmp r0, #3
bhi .L2
lsl r0, r0, #1
add r1, r1, r0
.L2:
mov r2, #2
add r0, sp, #4
bl memcpy
add r3, sp, #4
ldrb r0, [r3, #1]
ldrb r2, [r3]
lsl r0, r0, #8
orr r0, r2
@ sp needed for prologue
pop {r1, r2, r3, pc}