aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/arm
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2009-06-02 07:47:09 +0000
committerRichard Earnshaw <rearnsha@gcc.gnu.org>2009-06-02 07:47:09 +0000
commit55b2829b99458634704698462459784bd324aea8 (patch)
tree345e54150acca6ed4c32ab4c6ba829ae98672436 /gcc/config/arm
parent18d6353c18fbf62f20bd1bff4a8fd734c01b21bc (diff)
downloadgcc-55b2829b99458634704698462459784bd324aea8.zip
gcc-55b2829b99458634704698462459784bd324aea8.tar.gz
gcc-55b2829b99458634704698462459784bd324aea8.tar.bz2
arm.c (arm_get_frame_offsets): Prefer using r3 for padding a push/pop multiple to 8-byte alignment.
* arm.c (arm_get_frame_offsets): Prefer using r3 for padding a push/pop multiple to 8-byte alignment. From-SVN: r148072
Diffstat (limited to 'gcc/config/arm')
-rw-r--r--gcc/config/arm/arm.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 8ae8dab..24a94a6 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -12822,22 +12822,23 @@ arm_get_frame_offsets (void)
{
int reg = -1;
- for (i = 4; i <= (TARGET_THUMB1 ? LAST_LO_REGNUM : 11); i++)
+ /* If it is safe to use r3, then do so. This sometimes
+ generates better code on Thumb-2 by avoiding the need to
+ use 32-bit push/pop instructions. */
+ if (!crtl->tail_call_emit
+ && arm_size_return_regs () <= 12)
{
- if ((offsets->saved_regs_mask & (1 << i)) == 0)
- {
- reg = i;
- break;
- }
- }
-
- if (reg == -1 && arm_size_return_regs () <= 12
- && !crtl->tail_call_emit)
- {
- /* Push/pop an argument register (r3) if all callee saved
- registers are already being pushed. */
reg = 3;
}
+ else
+ for (i = 4; i <= (TARGET_THUMB1 ? LAST_LO_REGNUM : 11); i++)
+ {
+ if ((offsets->saved_regs_mask & (1 << i)) == 0)
+ {
+ reg = i;
+ break;
+ }
+ }
if (reg != -1)
{