I'm seeing some inconsistent sp reset code in generated output.
On entry it will use str[d] rfoo,[sp,-n*8] or add sp,sp,-n*8 but on exit it wont always use the expected add sp,sp,n*8 - sometimes it uses mov r12,#n*8, add sp,sp,r12 instead. It may be related to whether the sp was saved to call a function or whether it was saved to make room for variables.
I don't have a specific example because it's a bit too rubber chicken waving / box of chocolate like as to what i'm going to get but the code immediately following the 'inline' header on this post demonstrates it occuring http://a-hackers-craic.blogspot.com.au/ ... reads.html
Is this an optimisation/machine tuning related "bug" or am I just expecting too much from a c compiler?