diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1995-04-17 13:49:59 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1995-04-17 13:49:59 -0700 |
commit | 0d9641d106bb9d99a32f98ed5be56f2aef3ff8b1 (patch) | |
tree | 746204aae31b807d4d94e95700a31f8e5fb47d69 | |
parent | 4ffeab028f6d04c6c34723c18c0441566363c2a2 (diff) | |
download | gcc-0d9641d106bb9d99a32f98ed5be56f2aef3ff8b1.zip gcc-0d9641d106bb9d99a32f98ed5be56f2aef3ff8b1.tar.gz gcc-0d9641d106bb9d99a32f98ed5be56f2aef3ff8b1.tar.bz2 |
(subst_prev_insn): New variable.
(try_combine): Set it.
(get_last_value): Use it.
From-SVN: r9396
-rw-r--r-- | gcc/combine.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 2bb00d4..a95284a 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -173,6 +173,11 @@ static int last_call_cuid; static rtx subst_insn; +/* This is an insn that belongs before subst_insn, but is not currently + on the insn chain. */ + +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 @@ -1358,8 +1363,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), @@ -9943,9 +9949,12 @@ get_last_value (x) /* If the value was set in a later insn than the ones we are processing, we can't use it even if the register was only set once, but make a quick check to see if the previous insn set it to something. This is commonly - the case when the same pseudo is used by repeated insns. */ + the case when the same pseudo is used by repeated insns. + + This does not work if there exists an instruction which is temporarily + not on the insn chain. */ - if (INSN_CUID (reg_last_set[regno]) >= subst_low_cuid) + if (INSN_CUID (reg_last_set[regno]) >= subst_low_cuid && ! subst_prev_insn) { rtx insn, set; |