From a6abdce327180878f4753126647b351026b2dcd0 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 11 Feb 2004 14:05:08 -0800 Subject: flow.c (insn_dead_p): A clobber of a dead hard register is a dead insn after reload. * flow.c (insn_dead_p): A clobber of a dead hard register is a dead insn after reload. From-SVN: r77674 --- gcc/flow.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'gcc/flow.c') diff --git a/gcc/flow.c b/gcc/flow.c index a12f0ed..56a0bfa 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -2267,14 +2267,22 @@ insn_dead_p (struct propagate_block_info *pbi, rtx x, int call_ok, } /* A CLOBBER of a pseudo-register that is dead serves no purpose. That - is not necessarily true for hard registers. */ - else if (code == CLOBBER && GET_CODE (XEXP (x, 0)) == REG - && REGNO (XEXP (x, 0)) >= FIRST_PSEUDO_REGISTER - && ! REGNO_REG_SET_P (pbi->reg_live, REGNO (XEXP (x, 0)))) - return 1; - - /* We do not check other CLOBBER or USE here. An insn consisting of just - a CLOBBER or just a USE should not be deleted. */ + is not necessarily true for hard registers until after reload. */ + else if (code == CLOBBER) + { + if (GET_CODE (XEXP (x, 0)) == REG + && (REGNO (XEXP (x, 0)) >= FIRST_PSEUDO_REGISTER + || reload_completed) + && ! REGNO_REG_SET_P (pbi->reg_live, REGNO (XEXP (x, 0)))) + return 1; + } + + /* ??? A base USE is a historical relic. It ought not be needed anymore. + Instances where it is still used are either (1) temporary and the USE + escaped the pass, (2) cruft and the USE need not be emitted anymore, + or (3) hiding bugs elsewhere that are not properly representing data + flow. */ + return 0; } -- cgit v1.1