diff options
author | Richard Earnshaw <rearnsha@arm.com> | 2003-01-30 15:39:43 +0000 |
---|---|---|
committer | Richard Earnshaw <rearnsha@gcc.gnu.org> | 2003-01-30 15:39:43 +0000 |
commit | e43dd89d8061e68695c871f7f6b044012dfcd82b (patch) | |
tree | 61ef8cef0299e95bee7a24ed0450b1ce1969dde5 /gcc | |
parent | 87a902e411978db4d5d8bf8eca4f02561d949cbf (diff) | |
download | gcc-e43dd89d8061e68695c871f7f6b044012dfcd82b.zip gcc-e43dd89d8061e68695c871f7f6b044012dfcd82b.tar.gz gcc-e43dd89d8061e68695c871f7f6b044012dfcd82b.tar.bz2 |
arm.c (arm_compute_initial_elimination_offset): If optimizing for size...
* arm.c (arm_compute_initial_elimination_offset): If optimizing for
size, the link register is always saved if any other register is
saved.
From-SVN: r62142
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8ba5264..4e7b7e8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-01-30 Richard Earnshaw <rearnsha@arm.com> + + * arm.c (arm_compute_initial_elimination_offset): If optimizing for + size, the link register is always saved if any other register is + saved. + 2003-01-30 Kazu Hirata <kazu@cs.umass.edu> * config/h8300/h8300-protos.h: Update the prototype for diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 20ae697..3a8d993 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -8648,10 +8648,14 @@ arm_compute_initial_elimination_offset (from, to) reg_mask = reg_mask & ~ (reg_mask & - reg_mask); } - if (regs_ever_live[LR_REGNUM] - /* If a stack frame is going to be created, the LR will - be saved as part of that, so we do not need to allow - for it here. */ + if ((regs_ever_live[LR_REGNUM] + /* If optimizing for size, then we save the link register if + any other integer register is saved. This gives a smaller + return sequence. */ + || (optimize_size && call_saved_registers > 0)) + /* But if a stack frame is going to be created, the LR will + be saved as part of that, so we do not need to allow for + it here. */ && ! frame_pointer_needed) call_saved_registers += 4; |