aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1992-07-31 08:11:54 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1992-07-31 08:11:54 -0400
commit510dd77e9569867570a74513c79eb767344370c6 (patch)
tree22c8628cde5f7744c664c8ae0aa453e22e9eea81 /gcc/combine.c
parent87b36970b70a7af4b76f5cd13c601e1319b8e4b9 (diff)
downloadgcc-510dd77e9569867570a74513c79eb767344370c6.zip
gcc-510dd77e9569867570a74513c79eb767344370c6.tar.gz
gcc-510dd77e9569867570a74513c79eb767344370c6.tar.bz2
*** empty log message ***
From-SVN: r1730
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index b3865ed..ab9b09d 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -8095,6 +8095,18 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1)
if (XEXP (note, 0) == elim_i2 || XEXP (note, 0) == elim_i1)
break;
+ /* If the register is used in both I2 and I3 and it dies in I3,
+ we might have added another reference to it. If reg_n_refs
+ was 2, bump it to 3. This has to be correct since the
+ register must have been set somewhere. The reason this is
+ done is because local-alloc.c treats 2 references as a
+ special case. */
+
+ if (place == i3 && i2 != 0 && GET_CODE (XEXP (note, 0)) == REG
+ && reg_n_refs[REGNO (XEXP (note, 0))]== 2
+ && reg_referenced_p (XEXP (note, 0), PATTERN (i2)))
+ reg_n_refs[REGNO (XEXP (note, 0))] = 3;
+
if (place == 0)
for (tem = prev_nonnote_insn (i3);
tem && (GET_CODE (tem) == INSN