public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug translation/54067] New: arm-none-eabi with -mapcs and attribute((interrupt)) generates wrong stack alignment
@ 2012-07-22 17:57 mrks at koios dot de
  2012-07-23 10:00 ` [Bug translation/54067] " rearnsha at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mrks at koios dot de @ 2012-07-22 17:57 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54067
           Summary: arm-none-eabi with -mapcs and attribute((interrupt))
                    generates wrong stack alignment
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: translation
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mrks@koios.de


Created attachment 27853
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27853
simple code to reproduce error

If a function has __attribute__((interrupt("IRQ"))) set and is compiled with
arm-none-eabi and the option -mapcs, the generated prologue looks something
like

push {ip}
...
push {...}
...
sub sp, sp, ...

the first push {ip} is special when compiling with -mapcs and the function
attribute, but it seems this extra word is ignored when the stack is to be
aligned.
Thus when strd/ldrd instructions are generated accessing the stack you'll end
up in an alignment fault.


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

* [Bug translation/54067] arm-none-eabi with -mapcs and attribute((interrupt)) generates wrong stack alignment
  2012-07-22 17:57 [Bug translation/54067] New: arm-none-eabi with -mapcs and attribute((interrupt)) generates wrong stack alignment mrks at koios dot de
@ 2012-07-23 10:00 ` rearnsha at gcc dot gnu.org
  2012-07-23 10:26 ` rearnsha at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2012-07-23 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Earnshaw <rearnsha at gcc dot gnu.org> 2012-07-23 10:00:41 UTC ---
The -mapcs option isn't expected to work on AAPCS based targets.  We should fix
the compiler to reject this combination.


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

* [Bug translation/54067] arm-none-eabi with -mapcs and attribute((interrupt)) generates wrong stack alignment
  2012-07-22 17:57 [Bug translation/54067] New: arm-none-eabi with -mapcs and attribute((interrupt)) generates wrong stack alignment mrks at koios dot de
  2012-07-23 10:00 ` [Bug translation/54067] " rearnsha at gcc dot gnu.org
@ 2012-07-23 10:26 ` rearnsha at gcc dot gnu.org
  2012-09-04 19:53 ` ramana at gcc dot gnu.org
  2012-11-19 11:58 ` [Bug target/54067] " redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2012-07-23 10:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Earnshaw <rearnsha at gcc dot gnu.org> 2012-07-23 10:26:06 UTC ---
Hmm, I got myself confused with the undocumented option.  -mapcs has the same
behaviour as -mapcs-frame, which should work (generate code that will execute
correctly) even in this context; though back-tracing through an interrupt frame
is probably never going to work.


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

* [Bug translation/54067] arm-none-eabi with -mapcs and attribute((interrupt)) generates wrong stack alignment
  2012-07-22 17:57 [Bug translation/54067] New: arm-none-eabi with -mapcs and attribute((interrupt)) generates wrong stack alignment mrks at koios dot de
  2012-07-23 10:00 ` [Bug translation/54067] " rearnsha at gcc dot gnu.org
  2012-07-23 10:26 ` rearnsha at gcc dot gnu.org
@ 2012-09-04 19:53 ` ramana at gcc dot gnu.org
  2012-11-19 11:58 ` [Bug target/54067] " redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: ramana at gcc dot gnu.org @ 2012-09-04 19:53 UTC (permalink / raw)
  To: gcc-bugs

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

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-09-04
                 CC|                            |ramana at gcc dot gnu.org
     Ever Confirmed|0                           |1
      Known to fail|                            |4.7.1, 4.8.0


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

* [Bug target/54067] arm-none-eabi with -mapcs and attribute((interrupt)) generates wrong stack alignment
  2012-07-22 17:57 [Bug translation/54067] New: arm-none-eabi with -mapcs and attribute((interrupt)) generates wrong stack alignment mrks at koios dot de
                   ` (2 preceding siblings ...)
  2012-09-04 19:53 ` ramana at gcc dot gnu.org
@ 2012-11-19 11:58 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2012-11-19 11:58 UTC (permalink / raw)
  To: gcc-bugs


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|translation                 |target

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-11-19 11:57:43 UTC ---
(wrong component)


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

end of thread, other threads:[~2012-11-19 11:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-22 17:57 [Bug translation/54067] New: arm-none-eabi with -mapcs and attribute((interrupt)) generates wrong stack alignment mrks at koios dot de
2012-07-23 10:00 ` [Bug translation/54067] " rearnsha at gcc dot gnu.org
2012-07-23 10:26 ` rearnsha at gcc dot gnu.org
2012-09-04 19:53 ` ramana at gcc dot gnu.org
2012-11-19 11:58 ` [Bug target/54067] " redi at gcc dot gnu.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).