public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* target/7328: stack restoration for ARM interrupt("IRQ") attribute
@ 2002-07-16 7:06 jean-marc.koller
0 siblings, 0 replies; 2+ messages in thread
From: jean-marc.koller @ 2002-07-16 7:06 UTC (permalink / raw)
To: gcc-gnats
>Number: 7328
>Category: target
>Synopsis: stack restoration for ARM interrupt("IRQ") attribute
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Tue Jul 16 07:06:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Jean-Marc Koller, CSEM SA, Switzerland
>Release: gcc 3.1 and "3.2 20020715 (experimental)"
>Organization:
>Environment:
SuSE Linux i686, gcc compiled for ARM-elf target
>Description:
On interrupt calls, the interrupt handler does not restore the interrupt stack pointer, thus leading to interrupt stack overflow.
The following C code:
"
void isr_IRQ() __attribute__((interrupt("IRQ")));
extern void dummy();
void isr_IRQ()
{
dummy();
}
"
generates:
"
isr_IRQ:
@ Interrupt Service Routine.
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 1, uses_anonymous_args = 0
str ip, [sp, #-4]!
sub lr, lr, #4
mov ip, sp
stmfd sp!, {r0, r1, r2, r3, fp, ip, lr, pc}
sub fp, ip, #4
bl dummy
ldmea fp, {r0, r1, r2, r3, fp, ip, pc}^
"
which doesn't restore sp on ldmea.
>How-To-Repeat:
arm-elf-gcc -Wall -S except_test.c -O2
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-csrc; name="except_test.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="except_test.c"
dm9pZCBpc3JfSVJRKCkJX19hdHRyaWJ1dGVfXygoaW50ZXJydXB0KCJJUlEiKSkpOwoKZXh0ZXJu
IHZvaWQgZHVtbXkoKTsKCnZvaWQgaXNyX0lSUSgpCnsKCWR1bW15KCk7Cn0K
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: target/7328: stack restoration for ARM interrupt("IRQ") attribute
@ 2002-07-16 7:58 rearnsha
0 siblings, 0 replies; 2+ messages in thread
From: rearnsha @ 2002-07-16 7:58 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, jean-marc.koller, nobody
Synopsis: stack restoration for ARM interrupt("IRQ") attribute
State-Changed-From-To: open->analyzed
State-Changed-By: rearnsha
State-Changed-When: Tue Jul 16 07:58:52 2002
State-Changed-Why:
Confirmed. I sugest that you compile your code with -mno-apcs-frame
for now.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7328
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-07-16 14:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-16 7:06 target/7328: stack restoration for ARM interrupt("IRQ") attribute jean-marc.koller
2002-07-16 7:58 rearnsha
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).