public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: jean-marc.koller@csem.ch
To: gcc-gnats@gcc.gnu.org
Subject: target/7328: stack restoration for  ARM interrupt("IRQ") attribute
Date: Tue, 16 Jul 2002 07:06:00 -0000	[thread overview]
Message-ID: <20020716135759.20792.qmail@sources.redhat.com> (raw)


>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


             reply	other threads:[~2002-07-16 14:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-16  7:06 jean-marc.koller [this message]
2002-07-16  7:58 rearnsha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020716135759.20792.qmail@sources.redhat.com \
    --to=jean-marc.koller@csem.ch \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).