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

--- Comment #12 from nsz at gcc dot gnu.org ---
the wrong string seems to be caused by a missing ldm

good main:
        ...
        mov     r4, #0
        str     r4, [sp, #32]
        mov     r2, #2
        str     r2, [sp, #36]
        add     r2, sp, #40
        str     r2, [sp, #4]
        str     r4, [sp, #8]
        ldm     ip, {r0, r1}    /// load r0 (content is 'hell')
        str     r0, [sp, #40]   /// store the right r0
        strh    r1, [sp, #44]   @ movhi
        ldr     r2, [sp, #66]   @ unaligned
        str     r2, [sp, #46]   @ unaligned
        ldrh    r2, [sp, #70]   @ unaligned
        strh    r2, [sp, #50]   @ unaligned
        add     r2, sp, #72
        ldm     r2, {r0, r1}
        str     r0, [sp, #52]
        strh    r1, [sp, #56]   @ movhi
        mov     r1, r3
        add     r0, sp, #4
        bl      option_stopwatch_a.5061

bad main:
        ...
        mov     r4, #0
        str     r4, [sp, #32]
        mov     r2, #2
        str     r2, [sp, #36]
        add     r2, sp, #40
        str     r2, [sp, #4]
        str     r4, [sp, #8]
        ldr     r1, [sp, #64]
        str     r0, [sp, #40]   /// store a bad r0 (content is 'godd')
        strh    r1, [sp, #44]   @ movhi
        ldr     r2, [sp, #66]   @ unaligned
        str     r2, [sp, #46]   @ unaligned
        ldrh    r2, [sp, #70]   @ unaligned
        strh    r2, [sp, #50]   @ unaligned
        ldr     r1, [sp, #76]
        str     r0, [sp, #52]
        strh    r1, [sp, #56]   @ movhi
        mov     r1, r3
        add     r0, sp, #4
        bl      option_stopwatch_a.5061

Reply via email to