This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix reload to not eliminate insns that may throw
- To: gcc-patches at gcc dot gnu dot org
- Subject: Fix reload to not eliminate insns that may throw
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Thu, 8 Nov 01 18:50:38 EST
This prevents reload from elimnating an insn if it can throw. With the
recent patch to remove REG_EH_REGION notes when no longer needed, this
shouldn't be a problem, but no harm is done in being safe like this.
Tested on alphaev56-dec-osf4.0c.
Thu Nov 8 18:00:55 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload1.c (reload): Don't delete equiv insn if can throw.
*** reload1.c 2001/11/03 15:50:04 1.309
--- reload1.c 2001/11/08 14:50:31
*************** reload (first, global)
*** 1072,1078 ****
{
rtx equiv_insn = XEXP (list, 0);
! if (GET_CODE (equiv_insn) == NOTE)
! continue;
! if (reg_set_p (regno_reg_rtx[i], PATTERN (equiv_insn)))
delete_dead_insn (equiv_insn);
else
--- 1072,1085 ----
{
rtx equiv_insn = XEXP (list, 0);
!
! /* If we already deleted the insn or if it may trap, we can't
! delete it. The latter case shouldn't happen, but can
! if an insn has a variable address, gets a REG_EH_REGION
! note added to it, and then gets converted into an load
! from a constant address. */
! if (GET_CODE (equiv_insn) == NOTE
! || can_throw_internal (equiv_insn))
! ;
! else if (reg_set_p (regno_reg_rtx[i], PATTERN (equiv_insn)))
delete_dead_insn (equiv_insn);
else