This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12084] New: 3.3.1 emitting strange stack handling code for ARM interrupts
- From: "jamesl at appliedminds dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Aug 2003 01:12:08 -0000
- Subject: [Bug c/12084] New: 3.3.1 emitting strange stack handling code for ARM interrupts
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12084
Summary: 3.3.1 emitting strange stack handling code for ARM
interrupts
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jamesl at appliedminds dot com
CC: gcc-bugs at gcc dot gnu dot org
The following was compiled with arm-elf-gcc -S -g -O2 -Wall -mcpu=arm7tdmi
void int_handler(void) __attribute__((interrupt("IRQ")));
void foo(void)
{
}
void int_handler(void)
{
foo();
}
It emitted this assembly for int_handler:
int_handler:
.LFB5:
.loc 1 8 0
@ Interrupt Service Routine.
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 1, uses_anonymous_args = 0
str ip, [sp, #-4]!
mov ip, sp
.LCFI0:
stmfd sp!, {r0, r1, r2, r3, fp, ip, lr, pc}
.LCFI1:
sub fp, ip, #4
.LCFI2:
.loc 1 9 0
bl foo
ldmea fp, {r0, r1, r2, r3, fp, sp, lr}
ldmfd sp!, {ip}
subs pc, lr, #4
1) The stack pointer is not being reset to its original location.
2) One of those ldm** needs a ^ after it to restore the correct CPSR.
This seems to be the same bug as in 3.2