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
This commit is contained in:
Alexandre Oliva 2001-09-29 21:52:12 +00:00 committed by Alexandre Oliva
parent 9f57ca195a
commit 3d17d93d9f
4 changed files with 67 additions and 10 deletions

View File

@ -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.

View File

@ -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);
}

View File

@ -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;
}
}

View File

@ -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));