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: unassig...@gcc.gnu.org
        ReportedBy: m...@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.

Reply via email to