This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/40730] redundant memory load
- From: "carrot at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jan 2010 06:47:00 -0000
- Subject: [Bug target/40730] redundant memory load
- References: <bug-40730-17659@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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