summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-11 22:05:08 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-11 22:05:08 +0000
commit40d28aff0745d807be1d1e07747bc3f32e62ff29 (patch)
tree035316708f577cbd4734f79077c152014d4035d3 /gcc
parentc12cb392c91148c60d164843dc9fb93bbfda81ad (diff)
downloadgcc-40d28aff0745d807be1d1e07747bc3f32e62ff29.tar.gz
* flow.c (insn_dead_p): A clobber of a dead hard register is a
dead insn after reload. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77674 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/flow.c24
2 files changed, 21 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9c1aa8a5b2d..9c734409a72 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-11 Richard Henderson <rth@redhat.com>
+
+ * flow.c (insn_dead_p): A clobber of a dead hard register is a
+ dead insn after reload.
+
2004-02-11 Ulrich Weigand <uweigand@de.ibm.com>
* tree.h (frame_base_decl): Add GTY marker.
diff --git a/gcc/flow.c b/gcc/flow.c
index a12f0ed2101..56a0bfa1db5 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;
}