[Bug target/43698] Invalid code when building gentoo pax-utils-0.1.19 with -Os optimizations

mikpe at it dot uu dot se gcc-bugzilla@gcc.gnu.org
Fri Apr 9 06:57:00 GMT 2010



------- Comment #2 from mikpe at it dot uu dot se  2010-04-09 06:57 -------
Compiling this with gcc-4.5.0-RC-20100406 -march=armv7-a -Os I get:

X:
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
        ldr     r3, .L4
        ldr     r2, [r2, #0]
        ldr     r1, [r1, #0]
        ldrb    r3, [r3, #0]    @ zero_extendqisi2
        cmp     r3, #0
        moveq   r3, r2, asr #31
        rev     r2, r2
        movne   r3, #0
.L3:
        add     r2, r1, r2
        str     r2, [r0, #0]
        bx      lr
.L5:
        .align  2
.L4:
        .word   .LANCHOR0
...
.LANCHOR0 = . + 0
        .type   do_reverse_endian, %object
        .size   do_reverse_endian, 1
do_reverse_endian:
        .space  1

which looks completely bogus. It's unconditionally rev:ing *phoff in r2 and
conditionally (based on do_reverse_endian) munging r3 which is dead.

I can't test this however as my HW is armv5tel.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43698



More information about the Gcc-bugs mailing list