]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* combine.c (combine_simplify_rtx): Fix RTL sharing bug.
authorUlrich Weigand <uweigand@de.ibm.com>
Mon, 25 Aug 2003 20:10:03 +0000 (20:10 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Mon, 25 Aug 2003 20:10:03 +0000 (20:10 +0000)
From-SVN: r70778

gcc/ChangeLog
gcc/combine.c

index ff2e17591a384f5921e93c31d63137c11aeadad1..019fca2fa6edc43930880838e1e3430882c6f0eb 100644 (file)
@@ -1,3 +1,7 @@
+2003-08-25  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * combine.c (combine_simplify_rtx): Fix RTL sharing bug.
+
 2003-08-25  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        * pretty-print.h (pp_maybe_newline_and_indent): New macro.
index 821acb2288445f9db56206b98a995515fc3e18fb..67e4b0195670a608db603df6075b25354b100018 100644 (file)
@@ -3636,9 +3636,11 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int last,
            return x;
 
          /* Simplify the alternative arms; this may collapse the true and
-            false arms to store-flag values.  */
-         true_rtx = subst (true_rtx, pc_rtx, pc_rtx, 0, 0);
-         false_rtx = subst (false_rtx, pc_rtx, pc_rtx, 0, 0);
+            false arms to store-flag values.  Be careful to use copy_rtx
+            here since true_rtx or false_rtx might share RTL with x as a
+            result of the if_then_else_cond call above.  */
+         true_rtx = subst (copy_rtx (true_rtx), pc_rtx, pc_rtx, 0, 0);
+         false_rtx = subst (copy_rtx (false_rtx), pc_rtx, pc_rtx, 0, 0);
 
          /* If true_rtx and false_rtx are not general_operands, an if_then_else
             is unlikely to be simpler.  */