aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-08-04 18:28:48 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-08-04 18:28:48 -0400
commit05b4c365bb02319e3106ab950c14fb5f8f604213 (patch)
tree88c2268d281caba41c66493a061848e4434fcd1c /gcc
parent065e678f6ecb3688e60ffa02b10c703efc694103 (diff)
downloadgcc-05b4c365bb02319e3106ab950c14fb5f8f604213.zip
gcc-05b4c365bb02319e3106ab950c14fb5f8f604213.tar.gz
gcc-05b4c365bb02319e3106ab950c14fb5f8f604213.tar.bz2
(eliminate_regs_in_insn): Always do elimination in REG_NOTES if we
changed anything in the insn. From-SVN: r5069
Diffstat (limited to 'gcc')
-rw-r--r--gcc/reload1.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 158b0a3..6d872ec 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -3158,8 +3158,7 @@ eliminate_regs_in_insn (insn, replace)
old_asm_operands_vec = 0;
/* Replace the body of this insn with a substituted form. If we changed
- something, return non-zero. If this is the final call for this
- insn (REPLACE is non-zero), do the elimination in REG_NOTES as well.
+ something, return non-zero.
If we are replacing a body that was a (set X (plus Y Z)), try to
re-recognize the insn. We do this in case we had a simple addition
@@ -3197,8 +3196,6 @@ eliminate_regs_in_insn (insn, replace)
else
PATTERN (insn) = new_body;
- if (replace && REG_NOTES (insn))
- REG_NOTES (insn) = eliminate_regs (REG_NOTES (insn), 0, NULL_RTX);
val = 1;
}
@@ -3240,6 +3237,14 @@ eliminate_regs_in_insn (insn, replace)
}
done:
+ /* If we changed something, perform elmination in REG_NOTES. This is
+ needed even when REPLACE is zero because a REG_DEAD note might refer
+ to a register that we eliminate and could cause a different number
+ of spill registers to be needed in the final reload pass than in
+ the pre-passes. */
+ if (val)
+ REG_NOTES (insn) = eliminate_regs (REG_NOTES (insn), 0, NULL_RTX);
+
if (! replace)
pop_obstacks ();