OSDN Git Service

PR rtl-optimization/27736
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 May 2006 15:07:00 +0000 (15:07 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 23 May 2006 15:07:00 +0000 (15:07 +0000)
* combine.c (replaced_rhs_value): New variable.
(combine_instructions): Set it.
(distribute_notes): When distributing a note in replaced_rhs_insn,
check whether the value was used in replaced_rhs_value.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114019 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/combine.c

index 219face..57e7201 100644 (file)
@@ -1,3 +1,11 @@
+2006-05-23  Richard Sandiford  <richard@codesourcery.com>
+
+       PR rtl-optimization/27736
+       * combine.c (replaced_rhs_value): New variable.
+       (combine_instructions): Set it.
+       (distribute_notes): When distributing a note in replaced_rhs_insn,
+       check whether the value was used in replaced_rhs_value.
+
 2006-05-23  Andrew MacLeod  <amacleod@redhat.com>
 
        PR c++/26757
index 4d71b6d..727e625 100644 (file)
@@ -128,6 +128,11 @@ static int total_attempts, total_merges, total_extras, total_successes;
    so modified, or null if none.  */
 
 static rtx replaced_rhs_insn;
+
+/* When REPLACED_RHS_INSN is nonnull, this is a copy of the new right
+   hand side.  */
+
+static rtx replaced_rhs_value;
 \f
 /* Vector mapping INSN_UIDs to cuids.
    The cuids are like uids but increase monotonically always.
@@ -928,6 +933,7 @@ combine_instructions (rtx f, unsigned int nregs)
                      rtx orig = SET_SRC (set);
                      SET_SRC (set) = note;
                      replaced_rhs_insn = temp;
+                     replaced_rhs_value = copy_rtx (note);
                      next = try_combine (insn, temp, NULL_RTX,
                                          &new_direct_jump_p);
                      replaced_rhs_insn = NULL;
@@ -12122,7 +12128,9 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2, rtx elim_i2,
             In both cases, we must search to see if we can find a previous
             use of A and put the death note there.  */
 
-         if (from_insn && from_insn == replaced_rhs_insn)
+         if (from_insn
+             && from_insn == replaced_rhs_insn
+             && !reg_overlap_mentioned_p (XEXP (note, 0), replaced_rhs_value))
            tem = from_insn;
          else
            {