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

--- Comment #2 from Hans Buchmann <hans.buchmann at fhnw dot ch> ---
The code is produced in arm mode:

        .file   "irq.cc"
        .text
        .align  2
        .global _Z5_irq_v
        .syntax unified
        .arm <------------------- here
        .fpu softvfp
        .type   _Z5_irq_v, %function
_Z5_irq_v:
        .fnstart
.LFB0:
        @ Interrupt Service Routine.
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        sub     lr, lr, #4
        push    {r0, r1, r2, r3, ip, lr}
        .save {r0, r1, r2, r3, ip, lr}
        bl      _Z8externalv
        pop     {r0, r1, r2, r3, ip, pc}^
        .fnend
        .size   _Z5_irq_v, .-_Z5_irq_v
        .ident  "GCC: (GNU) 6.1.0"

compiling with -mthumb yields the correct error:

../src/irq.cc: In function 'void _irq_()':
../src/irq.cc:11:1: error: interrupt Service Routines cannot be coded in Thumb
mode
 }

Reply via email to