[Bug optimization/11222] arm/thumb __Unwind_SjLj_Register prologue optimization causes crash on interrupts

mrbolha at ukonline dot co dot uk gcc-bugzilla@gcc.gnu.org
Sat Jul 12 02:04:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


mrbolha at ukonline dot co dot uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|3.2.2                       |3.3


------- Additional Comments From mrbolha at ukonline dot co dot uk  2003-07-12 02:04 -------
I know I shouldn't submit the assembler code, but this is just the part where
the bug is, I think it might help illustrate it.

_ZN1AC1Ei: // Constructor for class "A"
    push    {r4, r5, r6, r7, lr}
    (...) // Ommited part, just pushing registers to the stack
    mov r2, #48
    mov r3, #52
    mov r7, sp       // here, r7 points to the top of the stack
    neg r2, r2
    neg r3, r3
    str r1, [r3, r7] // Oops, messing with the area before the top of the stack 
                     // (the local vars)

    str r0, [r2, r7] // Again
    ldr r3, .L28
    mov r2, #20
    neg r2, r2
    str r3, [r2, r7] // And again
    ldr r3, .L28+4
    mov r2, #16
    neg r2, r2
    str r3, [r2, r7] // Yet again
    mov r3, #12
    neg r3, r3
    str r7, [r3, r7] // Geez, won't you stop it?
    mov r2, #8
    ldr r3, .L28+8
    sub sp, sp, #60  // Finally decrements the stack pointer...
(...)



More information about the Gcc-bugs mailing list