summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2000-12-29 17:48:08 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2000-12-29 17:48:08 +0000
commit0f3626789c6e09b6cfaf7d6a875052dad8671423 (patch)
tree08ddd986dbbd67053b634d70b2d98eff40550070
parent22cf44bc1d44921146a9f3345a6e922ecfd0e889 (diff)
downloadgcc-0f3626789c6e09b6cfaf7d6a875052dad8671423.tar.gz
Compute REG_N_SETS for ORIGINAL_REGNOs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38547 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/flow.c16
2 files changed, 20 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7adec343830..52759c5a053 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2000-12-29 Bernd Schmidt <bernds@redhat.com>
+ * flow.c (PROP_POSTRELOAD): New macro.
+ (update_life_info): Add it to prop_flags.
+ (mark_set_1): If it is set, compute REG_N_SETS for the original
+ register number of a hard reg.
+
* emit-rtl.c (gen_raw_REG): New function.
(gen_rtx_REG, gen_reg_rtx, init_emit_once): Use it instead of
gen_rtx_raw_REG.
diff --git a/gcc/flow.c b/gcc/flow.c
index 61371177437..26b985d9c82 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -168,6 +168,10 @@ Boston, MA 02111-1307, USA. */
#define EPILOGUE_USES(REGNO) 0
#endif
+/* Not in basic-block.h, since it is private to this file. When set, it
+ causes us to keep REG_N_SETS uptodate for original pseudo registers. */
+#define PROP_POSTRELOAD 64
+
/* The obstack on which the flow graph components are allocated. */
struct obstack flow_obstack;
@@ -2975,6 +2979,9 @@ update_life_info (blocks, extent, prop_flags)
tmp = INITIALIZE_REG_SET (tmp_head);
+ if (reload_completed)
+ prop_flags |= PROP_POSTRELOAD;
+
/* For a global update, we go through the relaxation process again. */
if (extent != UPDATE_LIFE_LOCAL)
{
@@ -4549,6 +4556,7 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
rtx reg, cond, insn;
int flags;
{
+ int orig_regno = -1;
int regno_first = -1, regno_last = -1;
int not_dead = 0;
int i;
@@ -4586,6 +4594,7 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
/* Fall through. */
case REG:
+ orig_regno = ORIGINAL_REGNO (reg);
regno_last = regno_first = REGNO (reg);
if (regno_first < FIRST_PSEUDO_REGISTER)
regno_last += HARD_REGNO_NREGS (regno_first, GET_MODE (reg)) - 1;
@@ -4730,7 +4739,7 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
/* Additional data to record if this is the final pass. */
if (flags & (PROP_LOG_LINKS | PROP_REG_INFO
- | PROP_DEATH_NOTES | PROP_AUTOINC))
+ | PROP_DEATH_NOTES | PROP_AUTOINC | PROP_POSTRELOAD))
{
register rtx y;
register int blocknum = pbi->bb->index;
@@ -4745,6 +4754,11 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
pbi->reg_next_use[i] = 0;
}
+ /* After reload has completed, try to keep REG_N_SETS uptodate for
+ the original pseudos. */
+ if ((flags & PROP_POSTRELOAD) && orig_regno >= FIRST_PSEUDO_REGISTER)
+ REG_N_SETS (orig_regno) += 1;
+
if (flags & PROP_REG_INFO)
{
for (i = regno_first; i <= regno_last; ++i)