aboutsummaryrefslogtreecommitdiff
path: root/gcc/local-alloc.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2001-11-14 22:02:24 -0500
committerDJ Delorie <dj@gcc.gnu.org>2001-11-14 22:02:24 -0500
commit902197eb4fbf3b936300d6df647e9d978d32ca28 (patch)
treefc5ff2b3569ac8524c310ed350940c212918d81a /gcc/local-alloc.c
parent6345b6810a52cf188959805bccc4ff8fba71ce74 (diff)
downloadgcc-902197eb4fbf3b936300d6df647e9d978d32ca28.zip
gcc-902197eb4fbf3b936300d6df647e9d978d32ca28.tar.gz
gcc-902197eb4fbf3b936300d6df647e9d978d32ca28.tar.bz2
integrate.c (get_hard_reg_initial_reg): New.
* integrate.c (get_hard_reg_initial_reg): New. * integrate.h (get_hard_reg_initial_reg): Prototype. * local-alloc.c (block_alloc): Don't tie pseudos that represent call-saved hard regs' initial values. From-SVN: r47037
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r--gcc/local-alloc.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 7de721e..1c45ae4 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -74,6 +74,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "output.h"
#include "toplev.h"
#include "except.h"
+#include "integrate.h"
/* Next quantity number available for allocation. */
@@ -1216,7 +1217,7 @@ block_alloc (b)
{
int i, q;
rtx insn;
- rtx note;
+ rtx note, hard_reg;
int insn_number = 0;
int insn_count = 0;
int max_uid = get_max_uid ();
@@ -1340,6 +1341,18 @@ block_alloc (b)
while (GET_CODE (r1) == PLUS || GET_CODE (r1) == MULT)
r1 = XEXP (r1, 0);
+ /* Avoid making a call-saved register unnecessarily
+ clobbered. */
+ hard_reg = get_hard_reg_initial_reg (cfun, r1);
+ if (hard_reg != NULL_RTX)
+ {
+ if (GET_CODE (hard_reg) == REG
+ && REGNO (hard_reg) >= 0
+ && REGNO (hard_reg) < FIRST_PSEUDO_REGISTER
+ && ! call_used_regs[REGNO (hard_reg)])
+ continue;
+ }
+
if (GET_CODE (r0) == REG || GET_CODE (r0) == SUBREG)
{
/* We have two priorities for hard register preferences.