[Bug target/83768] ARM: wrong optimization

ktkachov at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 10 16:16:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83768

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktkachov at gcc dot gnu.org

--- Comment #1 from ktkachov at gcc dot gnu.org ---
I can't reproduce it with a 5.4.1, I get:
        .cpu arm10tdmi
        .fpu vfp
        .eabi_attribute 20, 1
        .eabi_attribute 21, 1
        .eabi_attribute 23, 3
        .eabi_attribute 24, 1
        .eabi_attribute 25, 1
        .eabi_attribute 26, 2
        .eabi_attribute 30, 2
        .eabi_attribute 34, 0
        .eabi_attribute 18, 4
        .arm
        .syntax divided
        .file   "away.c"
        .text
        .align  2
        .global clean
        .type   clean, %function
clean:
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
        cmp     r1, #0
        addgt   r3, r0, r1
        movgt   r2, #0
        ble     .L7
.L4:
        strb    r2, [r0], #1
        cmp     r3, r0
        bne     .L4
        bx      lr
.L7:
        bx      lr
        .size   clean, .-clean
        .ident  "GCC: 5.4.1 20170805"
        .section        .note.GNU-stack,"",%progbits

I also can't reproduce with any compiler I have access to from 4.8 until
current trunk. Do you see this with an earlier compiler like 4.9 as well?


More information about the Gcc-bugs mailing list