Procedure call standard for ARM requires 8 byte alignment.
5.2.1.2 Stack constraints at a public interface
The stack must also conform to the following constraint at a public interface:
- SP mod 8 = 0. The stack must be double-word aligned.
Since you are producing assembly everything is exported by default, so you get 8 byte alignment. (I tried this and gcc doesn't add .global <symbol>
directive to static functions when generating assembly. I guess this says even a static function is a public interface or gcc just aligns every function to have 8-byte stack alignment.)
You can use -fomit-frame-pointer
to skip pushing r7
then gcc should leave the stack depth at 32.