aboutsummaryrefslogtreecommitdiff
path: root/gcc/local-alloc.c
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-03-22 03:36:46 +0000
committerRichard Stallman <rms@gnu.org>1992-03-22 03:36:46 +0000
commit333e0f7d36aa66fb00cf587d04a6738ee6c9f73a (patch)
tree5afa8a4ff7b83ce9fc4b920f91acf86fa420ddcf /gcc/local-alloc.c
parent391b99c9202dfc9b327ecf636a840e2229caf8ee (diff)
downloadgcc-333e0f7d36aa66fb00cf587d04a6738ee6c9f73a.zip
gcc-333e0f7d36aa66fb00cf587d04a6738ee6c9f73a.tar.gz
gcc-333e0f7d36aa66fb00cf587d04a6738ee6c9f73a.tar.bz2
*** empty log message ***
From-SVN: r562
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r--gcc/local-alloc.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 90cac29..fc45217 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -1729,7 +1729,8 @@ reg_is_born (reg, birth)
/* Record the death of REG in the current insn. If OUTPUT_P is non-zero,
REG is an output that is dying (i.e., it is never used), otherwise it
- is an input (the normal case). */
+ is an input (the normal case).
+ If OUTPUT_P is 1, then we extend the life past the end of this insn. */
static void
wipe_dead_reg (reg, output_p)
@@ -1738,6 +1739,25 @@ wipe_dead_reg (reg, output_p)
{
register int regno = REGNO (reg);
+ /* If this insn has multiple results,
+ and the dead reg is used in one of the results,
+ extend its life to after this insn,
+ so it won't get allocated together with any other result of this insn. */
+ if (GET_CODE (PATTERN (this_insn)) == PARALLEL
+ && !single_set (this_insn))
+ {
+ int i;
+ for (i = XVECLEN (PATTERN (this_insn), 0) - 1; i >= 0; i--)
+ {
+ rtx set = XVECEXP (PATTERN (this_insn), 0, i);
+ if (GET_CODE (set) == SET
+ && GET_CODE (SET_DEST (set)) != REG
+ && !rtx_equal_p (reg, SET_DEST (set))
+ && reg_overlap_mentioned_p (reg, SET_DEST (set)))
+ output_p = 1;
+ }
+ }
+
if (regno < FIRST_PSEUDO_REGISTER)
{
mark_life (regno, GET_MODE (reg), 0);