public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/16634] New: arm-elf-gcc 3.4.0 problems when generating code for __attribute__ ((interrupt ("IRQ")))
@ 2004-07-19 19:27 bob at cnxtech dot com
  2004-07-19 20:38 ` [Bug target/16634] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bob at cnxtech dot com @ 2004-07-19 19:27 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-07-02  1:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-19 19:27 [Bug c/16634] New: arm-elf-gcc 3.4.0 problems when generating code for __attribute__ ((interrupt ("IRQ"))) bob at cnxtech dot com
2004-07-19 20:38 ` [Bug target/16634] " pinskia at gcc dot gnu dot org
2004-10-07 16:14 ` [Bug target/16634] arm-elf-gcc " pinskia at gcc dot gnu dot org
2005-07-02  1:31 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).