diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1993-11-10 21:34:55 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1993-11-10 21:34:55 -0500 |
commit | 137e889e24e0dd048d56c47f6ee22026d2720e10 (patch) | |
tree | 568c474d5335d07be58a54153d4fc176680e9b43 /gcc | |
parent | e39bf2d9fcc8ef97898e317e62bb831b0b2e412f (diff) | |
download | gcc-137e889e24e0dd048d56c47f6ee22026d2720e10.zip gcc-137e889e24e0dd048d56c47f6ee22026d2720e10.tar.gz gcc-137e889e24e0dd048d56c47f6ee22026d2720e10.tar.bz2 |
(subst_prev_insn): New variable.
(try_combine): Set it.
(get_last_value): Use subst_prev_insn if set instead of looking for the first
insn before SUBST_LOW_CUID.
From-SVN: r6063
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/combine.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index fd55947..aed4627 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -159,6 +159,11 @@ static int last_call_cuid; static rtx subst_insn; +/* If nonzero, this is the insn that should be presumed to be + immediately in front of `subst_insn'. */ + +static rtx subst_prev_insn; + /* This is the lowest CUID that `subst' is currently dealing with. get_last_value will not return a value if the register was set at or after this CUID. If not for this mechanism, we could get confused if @@ -1195,6 +1200,8 @@ try_combine (i3, i2, i1) if (i1 && INSN_CUID (i1) > INSN_CUID (i2)) temp = i1, i1 = i2, i2 = temp; + subst_prev_insn = 0; + /* First check for one important special-case that the code below will not handle. Namely, the case where I1 is zero, I2 has multiple sets, and I3 is a SET whose SET_SRC is a SET_DEST in I2. In that case, @@ -1307,8 +1314,9 @@ try_combine (i3, i2, i1) never appear in the insn stream so giving it the same INSN_UID as I2 will not cause a problem. */ - i1 = gen_rtx (INSN, VOIDmode, INSN_UID (i2), 0, i2, - XVECEXP (PATTERN (i2), 0, 1), -1, 0, 0); + subst_prev_insn = i1 + = gen_rtx (INSN, VOIDmode, INSN_UID (i2), 0, i2, + XVECEXP (PATTERN (i2), 0, 1), -1, 0, 0); SUBST (PATTERN (i2), XVECEXP (PATTERN (i2), 0, 0)); SUBST (XEXP (SET_SRC (PATTERN (i2)), 0), @@ -9494,10 +9502,15 @@ get_last_value (x) { rtx insn, set; - for (insn = prev_nonnote_insn (subst_insn); - insn && INSN_CUID (insn) >= subst_low_cuid; - insn = prev_nonnote_insn (insn)) - ; + /* If there is an insn that is supposed to be immediately + in front of subst_insn, use it. */ + if (subst_prev_insn != 0) + insn = subst_prev_insn; + else + for (insn = prev_nonnote_insn (subst_insn); + insn && INSN_CUID (insn) >= subst_low_cuid; + insn = prev_nonnote_insn (insn)) + ; if (insn && (set = single_set (insn)) != 0 |