aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2001-09-29 21:52:12 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2001-09-29 21:52:12 +0000
commit3d17d93d9fe5c1141c319158e756f6b9b6300f86 (patch)
tree8b7cd2a3c1dc10fd6fe1a5ff6ec9025224f41a3e /gcc
parent9f57ca195a961a5ed6d93d6a7f570fd0de7e5c6e (diff)
downloadgcc-3d17d93d9fe5c1141c319158e756f6b9b6300f86.zip
gcc-3d17d93d9fe5c1141c319158e756f6b9b6300f86.tar.gz
gcc-3d17d93d9fe5c1141c319158e756f6b9b6300f86.tar.bz2
reload.c (find_reloads): Mark new USE insns with QImode.
* reload.c (find_reloads): Mark new USE insns with QImode. (find_reloads_toplev, find_reloads_address, subst_reg_equivs, find_reloads_subreg_address): Likewise. * regrename.c (note_sets, clear_dead_regs): Abort if pseudos are encountered. * reload1.c (reload_combine_note_use): Likewise, inside USEs and CLOBBERs. (reload): Make sure there are no USEs with mode other than VOIDmode. At the end, remove those marked with QImode. From-SVN: r45889
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/regrename.c10
-rw-r--r--gcc/reload.c32
-rw-r--r--gcc/reload1.c23
4 files changed, 67 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 15c1e61..8e5d182 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2001-09-29 Alexandre Oliva <aoliva@redhat.com>
+
+ * reload.c (find_reloads): Mark new USE insns with QImode.
+ (find_reloads_toplev, find_reloads_address, subst_reg_equivs,
+ find_reloads_subreg_address): Likewise.
+ * regrename.c (note_sets, clear_dead_regs): Abort if pseudos are
+ encountered.
+ * reload1.c (reload_combine_note_use): Likewise, inside USEs and
+ CLOBBERs.
+ (reload): Make sure there are no USEs with mode other than
+ VOIDmode. At the end, remove those marked with QImode.
+
2001-09-29 Per Bothner <per@bothner.com>
* cppdefault.c (cpp_include_defaults): Also search PREFIX_INCLUDE_DIR.
diff --git a/gcc/regrename.c b/gcc/regrename.c
index afee0d7..c0cf232 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -112,6 +112,11 @@ note_sets (x, set, data)
return;
regno = REGNO (x);
nregs = HARD_REGNO_NREGS (regno, GET_MODE (x));
+
+ /* There must not be pseudos at this point. */
+ if (regno + nregs > FIRST_PSEUDO_REGISTER)
+ abort ();
+
while (nregs-- > 0)
SET_HARD_REG_BIT (*pset, regno + nregs);
}
@@ -132,6 +137,11 @@ clear_dead_regs (pset, kind, notes)
rtx reg = XEXP (note, 0);
unsigned int regno = REGNO (reg);
int nregs = HARD_REGNO_NREGS (regno, GET_MODE (reg));
+
+ /* There must not be pseudos at this point. */
+ if (regno + nregs > FIRST_PSEUDO_REGISTER)
+ abort ();
+
while (nregs-- > 0)
CLEAR_HARD_REG_BIT (*pset, regno + nregs);
}
diff --git a/gcc/reload.c b/gcc/reload.c
index 8e6d2b3..cde3460 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -3816,7 +3816,11 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
if (GET_CODE (operand) == REG)
{
if (modified[i] != RELOAD_WRITE)
- emit_insn_before (gen_rtx_USE (VOIDmode, operand), insn);
+ /* We mark the USE with QImode so that we recognize
+ it as one that can be safely deleted at the end
+ of reload. */
+ PUT_MODE (emit_insn_before (gen_rtx_USE (VOIDmode, operand),
+ insn), QImode);
if (modified[i] != RELOAD_READ)
emit_insn_after (gen_rtx_CLOBBER (VOIDmode, operand), insn);
}
@@ -4302,7 +4306,11 @@ find_reloads_toplev (x, opnum, type, ind_levels, is_set_dest, insn,
this substitution. We have to emit a USE of the pseudo so
that delete_output_reload can see it. */
if (replace_reloads && recog_data.operand[opnum] != x)
- emit_insn_before (gen_rtx_USE (VOIDmode, x), insn);
+ /* We mark the USE with QImode so that we recognize it
+ as one that can be safely deleted at the end of
+ reload. */
+ PUT_MODE (emit_insn_before (gen_rtx_USE (VOIDmode, x), insn),
+ QImode);
x = mem;
i = find_reloads_address (GET_MODE (x), &x, XEXP (x, 0), &XEXP (x, 0),
opnum, type, ind_levels, insn);
@@ -4561,7 +4569,12 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
&& ! rtx_equal_p (tem, reg_equiv_mem[regno]))
{
*loc = tem;
- emit_insn_before (gen_rtx_USE (VOIDmode, ad), insn);
+ /* We mark the USE with QImode so that we
+ recognize it as one that can be safely
+ deleted at the end of reload. */
+ PUT_MODE (emit_insn_before (gen_rtx_USE (VOIDmode, ad),
+ insn), QImode);
+
/* This doesn't really count as replacing the address
as a whole, since it is still a memory access. */
}
@@ -4892,7 +4905,11 @@ subst_reg_equivs (ad, insn)
if (! rtx_equal_p (mem, reg_equiv_mem[regno]))
{
subst_reg_equivs_changed = 1;
- emit_insn_before (gen_rtx_USE (VOIDmode, ad), insn);
+ /* We mark the USE with QImode so that we recognize it
+ as one that can be safely deleted at the end of
+ reload. */
+ PUT_MODE (emit_insn_before (gen_rtx_USE (VOIDmode, ad), insn),
+ QImode);
return mem;
}
}
@@ -5724,7 +5741,12 @@ find_reloads_subreg_address (x, force_replace, opnum, type,
this substitution. We have to emit a USE of the pseudo so
that delete_output_reload can see it. */
if (replace_reloads && recog_data.operand[opnum] != x)
- emit_insn_before (gen_rtx_USE (VOIDmode, SUBREG_REG (x)), insn);
+ /* We mark the USE with QImode so that we recognize it
+ as one that can be safely deleted at the end of
+ reload. */
+ PUT_MODE (emit_insn_before (gen_rtx_USE (VOIDmode,
+ SUBREG_REG (x)),
+ insn), QImode);
x = tem;
}
}
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 82084325..bc3456f 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -758,6 +758,13 @@ reload (first, global)
{
rtx set = single_set (insn);
+ /* We may introduce USEs that we want to remove at the end, so
+ we'll mark them with QImode. Make sure there are no
+ previously-marked insns left by say regmove. */
+ if (INSN_P (insn) && GET_CODE (PATTERN (insn)) == USE
+ && GET_MODE (insn) != VOIDmode)
+ PUT_MODE (insn, VOIDmode);
+
if (GET_CODE (insn) == CALL_INSN
&& find_reg_note (insn, REG_SETJMP, NULL))
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
@@ -1183,7 +1190,9 @@ reload (first, global)
CALL_INSN_FUNCTION_USAGE (insn));
if ((GET_CODE (PATTERN (insn)) == USE
- && find_reg_note (insn, REG_EQUAL, NULL_RTX))
+ /* We mark with QImode USEs introduced by reload itself. */
+ && (GET_MODE (insn) == QImode
+ || find_reg_note (insn, REG_EQUAL, NULL_RTX)))
|| (GET_CODE (PATTERN (insn)) == CLOBBER
&& (GET_CODE (XEXP (PATTERN (insn), 0)) != REG
|| ! REG_FUNCTION_VALUE_P (XEXP (PATTERN (insn), 0)))))
@@ -8929,7 +8938,12 @@ reload_combine_note_use (xp, insn)
case CLOBBER:
if (GET_CODE (SET_DEST (x)) == REG)
- return;
+ {
+ /* No spurious CLOBBERs of pseudo registers may remain. */
+ if (REGNO (SET_DEST (x)) >= FIRST_PSEUDO_REGISTER)
+ abort ();
+ return;
+ }
break;
case PLUS:
@@ -8946,10 +8960,9 @@ reload_combine_note_use (xp, insn)
int use_index;
int nregs;
- /* Some spurious USEs of pseudo registers might remain.
- Just ignore them. */
+ /* No spurious USEs of pseudo registers may remain. */
if (regno >= FIRST_PSEUDO_REGISTER)
- return;
+ abort ();
nregs = HARD_REGNO_NREGS (regno, GET_MODE (x));