This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug translation/54067] New: arm-none-eabi with -mapcs and attribute((interrupt)) generates wrong stack alignment
- From: "mrks at koios dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 22 Jul 2012 17:57:24 +0000
- Subject: [Bug translation/54067] New: arm-none-eabi with -mapcs and attribute((interrupt)) generates wrong stack alignment
- Auto-submitted: auto-generated
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.