This was implemented in gcc-4.5, still works in gcc-4.5 branch. 2009-06-02 Richard Earnshaw <rearn...@arm.com>
* arm.c (arm_get_frame_offsets): Prefer using r3 for padding a push/pop multiple to 8-byte alignment. However, it doesn't work any longer on gcc-4.6 trunk. Reproduced on the following steps, $ arm-none-linux-gnueabi-gcc -Os -mthumb -march=armv7-a bashline.c -S On gcc-4.5 branch, r3 is used to keep stack alignment, which is expected. history_expand_line_internal: @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 push {r3, r4, r5, r6, r7, lr} However, on gcc-4.6 trunk, we can see that, r8 is used to keep stack alignment, which is *not* expected. history_expand_line_internal: @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 push {r4, r5, r6, r7, r8, lr} -- Summary: [regression 4.5] Fail to prefer using r3 for padding a push/pop multiple to 8-byte alignment Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: qiyao at gcc dot gnu dot org GCC host triplet: i486-build_pc-linux-gnu GCC target triplet: arm-unknown-linux-gnueabi http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45701