summaryrefslogtreecommitdiffstats
path: root/gcc/reload.c
diff options
context:
space:
mode:
authorcrux <crux@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-07 11:07:07 +0000
committercrux <crux@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-07 11:07:07 +0000
commit0d40c9f533cfd99ea6b31c72f8678a34006cfb5b (patch)
tree65b445029f288c5e129d33bebd33211ec797ee74 /gcc/reload.c
parent54f4746eeb34659759a87d7b8b799337fd530e9d (diff)
downloadppe42-gcc-0d40c9f533cfd99ea6b31c72f8678a34006cfb5b.tar.gz
ppe42-gcc-0d40c9f533cfd99ea6b31c72f8678a34006cfb5b.zip
Handle multiword modes in regno_clobbered_p
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36233 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload.c')
-rw-r--r--gcc/reload.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/gcc/reload.c b/gcc/reload.c
index ee2fa4884d2..d83b1f69e31 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -4519,7 +4519,7 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
else if (regno < FIRST_PSEUDO_REGISTER
&& REGNO_MODE_OK_FOR_BASE_P (regno, mode)
- && ! regno_clobbered_p (regno, this_insn))
+ && ! regno_clobbered_p (regno, this_insn, mode))
return 0;
/* If we do not have one of the cases above, we must do the reload. */
@@ -5427,7 +5427,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
in this insn, reload it into some other register to be safe.
The CLOBBER is supposed to make the register unavailable
from before this insn to after it. */
- if (regno_clobbered_p (regno, this_insn))
+ if (regno_clobbered_p (regno, this_insn, GET_MODE (x)))
{
push_reload (x, NULL_RTX, loc, NULL_PTR,
(context ? INDEX_REG_CLASS : BASE_REG_CLASS),
@@ -6544,13 +6544,21 @@ find_inc_amount (x, inced)
/* Return 1 if register REGNO is the subject of a clobber in insn INSN. */
int
-regno_clobbered_p (regno, insn)
+regno_clobbered_p (regno, insn, mode)
unsigned int regno;
rtx insn;
+ enum machine_mode mode;
{
+ int nregs = HARD_REGNO_NREGS (regno, mode);
+ int endregno = regno + nregs;
+
if (GET_CODE (PATTERN (insn)) == CLOBBER
&& GET_CODE (XEXP (PATTERN (insn), 0)) == REG)
- return REGNO (XEXP (PATTERN (insn), 0)) == regno;
+ {
+ int test = REGNO (XEXP (PATTERN (insn), 0));
+
+ return regno >= test && test < endregno;
+ }
if (GET_CODE (PATTERN (insn)) == PARALLEL)
{
@@ -6559,9 +6567,13 @@ regno_clobbered_p (regno, insn)
for (; i >= 0; i--)
{
rtx elt = XVECEXP (PATTERN (insn), 0, i);
- if (GET_CODE (elt) == CLOBBER && GET_CODE (XEXP (elt, 0)) == REG
- && REGNO (XEXP (elt, 0)) == regno)
- return 1;
+ if (GET_CODE (elt) == CLOBBER && GET_CODE (XEXP (elt, 0)) == REG)
+ {
+ int test = REGNO (XEXP (elt, 0));
+
+ if (regno >= test && test < endregno)
+ return 1;
+ }
}
}
OpenPOWER on IntegriCloud