This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/16634] New: arm-elf-gcc 3.4.0 problems when generating code for __attribute__ ((interrupt ("IRQ")))


The gcc 3.4.0 still have problems on generating the entry/exit code for
interrupts, if we supress the "apcs-frame" option. When the code is compiled
with "-mno-apcs-frame" the entry code subtracts 4 from the "lr" before pushing
it into stack, and do it again on the exit code.

__attribute__ ((interrupt ("IRQ"))) void int_handler(void)
{
	foo();
}
 
arm-elf-gcc -mcpu=arm7tdmi -mno-apcs-frame -mthumb-interwork -Wall -O2 -c test.c
00000000 <int_handler>:
   0:   e24ee004        sub     lr, lr, #4      ; 0x4
   4:   e92d500f        stmdb   sp!, {r0, r1, r2, r3, ip, lr}
   8:   ebfffffe        bl      0 <int_handler>
   c:   e8bd500f        ldmia   sp!, {r0, r1, r2, r3, ip, lr}
  10:   e25ef004        subs    pc, lr, #4      ; 0x4


arm-elf-gcc -mcpu=arm7tdmi -mapcs-frame -mthumb-interwork -Wall -O2 -c test.c
00000000 <int_handler>:
   0:   e52dc004        str     ip, [sp, -#4]!
   4:   e1a0c00d        mov     ip, sp
   8:   e92dd80f        stmdb   sp!, {r0, r1, r2, r3, fp, ip, lr, pc}
   c:   e24cb004        sub     fp, ip, #4      ; 0x4
  10:   ebfffffe        bl      0 <int_handler>
  14:   e89d680f        ldmia   sp, {r0, r1, r2, r3, fp, sp, lr}
  18:   e8bd1000        ldmia   sp!, {ip}
  1c:   e25ef004        subs    pc, lr, #4      ; 0x4

-- 
           Summary: arm-elf-gcc 3.4.0 problems when generating code for
                    __attribute__ ((interrupt ("IRQ")))
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bob at cnxtech dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-cygwin
GCC target triplet: arm-elf-gcc


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]