petermcs wrote on Thursday, December 13, 2012:
I’ve been doing a bit of digging on this and it is not as clear cut as it seems.
There is a potential issue with Cortex systems where the stack is not 8 byte aligned and you call functions with 64 bit parameters. The API specifies that call stacks between modules must be 8 byte aligned but depending on the Cortex model, this is not necessarily guaranteed. The following http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbcjggh.html has details on the issue and how the STKALIGN bit in the CCR register can be used to control this functionality.
With the GNU compiler and a Cortex M3, the __interrupt__ attribute causes the compiler to generate preamble code which guarantees 8 byte alignment but does change the stack frame in a way that is not consistent with the results of setting STKALIGN to 1.
I don’t know how much of an issue this is in reality but it might bear further scrutiny.