Since this is a recurring topic, I'm putting up a question about it.
According to AAPCS:
5.2.1.1 Universal stack constraints
- SP mod 4 = 0. The stack must at all times be aligned to a word boundary
5.2.1.2 Stack constraints at a public interface
- SP mod 8 = 0. The stack must be double-word aligned.
What is the rational behind 8-byte alignment?
Best Answer
The main reason is that that STRD and LDRD can only work on 8byte aligned addresses. So, to use them on stack variables the stackpointer needs to be 8-byte aligned to all the time.
To quote the ARM Website:
ARM also explains it in detail in this ABI Advisory Note.