[thumb2,size] Push/pop low register rather than high register when keeping stack alignment
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linaro GCC |
Won't Fix
|
Undecided
|
Unassigned | ||
4.5 |
Won't Fix
|
Undecided
|
Unassigned | ||
gcc |
Fix Released
|
Medium
|
Bug Description
As required by ARM EABI, stack should be 8byte aligned. In order to keep such alignment, GCC will push/pop register on stack.
In bash-3.
Dump of assembler code for function history_
0x00001c1c <+0>: stmdb sp!, {r4, r5, r6, r7, r8, lr} // <-- [1]
....
0x00001c4a <+46>: ldmia.w sp!, {r4, r5, r6, r7, r8, lr} // <-- [2]
0x00001c4e <+50>: b.w 0x1c4e <history_
0x00001c52 <+54>: ldmia.w sp!, {r4, r5, r6, r7, r8, pc} // <-- [3]
Possible improvement is,
[1] can be changed to push {r3, r4, r5, r6, r7, lr}
[2] can be changed to ldmia.w sp!, {r3, r4, r5, r6, r7, lr}
[3] can be changed to pop {r3, r4, r5, r6, r7, pc}
tags: | added: size task |
Changed in gcc-linaro: | |
status: | New → In Progress |
assignee: | nobody → Yao Qi (yao-codesourcery) |
Changed in gcc: | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
Changed in gcc-linaro: | |
assignee: | Yao Qi (yao-codesourcery) → nobody |
status: | In Progress → Won't Fix |
This was implemented (supposedly) in gcc-4.5 with
2009-06-02 Richard Earnshaw <email address hidden>
* arm.c (arm_get_ frame_offsets) : Prefer using r3 for padding a
push/pop multiple to 8-byte alignment.