lp:~rsandifo/gcc-linaro/lp-758082 fixes this but the code generated is
poor:

foo:
        push    {r1, r2, r3}
        ldr     r3, [r0, #0]
        push    {lr}
        sub     sp, sp, #8
        ldr     r3, [r3, #8]
        subs    r2, r3, #6
        it      ne
        movne   r2, #1
        cmp     r3, #8
        ite     eq
        moveq   r3, #0
        andne   r3, r2, #1
        cbnz    r3, .L1
        movw    r2, #:lower16:stdout
        add     r3, sp, #16
        movt    r2, #:upper16:stdout
        ldr     r1, [sp, #12]
        ldr     r0, [r2, #0]
        mov     r2, r3
        str     r3, [sp, #4]
        bl      vfprintf
.L1:
        add     sp, sp, #8
        pop     {lr}
        add     sp, sp, #12
        bx      lr

r1 doesn't need to be saved.  Ignoring hazards, r0 could be used instead
of r3.  The epilogue is poor due to the two adds.  lr could be pushed
with the initial push.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/758082

Title:
  [armel] segfaults in make check pass when built with optimization

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to