]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR rtl-optimization/49619 (ICE in simplify_subreg, at simplify-rtx.c...
authorJakub Jelinek <jakub@redhat.com>
Tue, 19 Jul 2011 12:58:54 +0000 (14:58 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 19 Jul 2011 12:58:54 +0000 (14:58 +0200)
Backport from mainline
2011-07-04  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/49619
* combine.c (combine_simplify_rtx): In PLUS -> IOR simplification
pass VOIDmode as op0_mode to recursive call.

* gcc.dg/pr49619.c: New test.

From-SVN: r176454

gcc/ChangeLog
gcc/combine.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr49619.c [new file with mode: 0644]

index 10977031214dc41503d61d6f11fc8194c2cf0e99..a0fa492467a657cb0e03d65d293b77b1ac6cfab7 100644 (file)
@@ -1,6 +1,12 @@
 2011-07-19  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from mainline
+       2011-07-04  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/49619
+       * combine.c (combine_simplify_rtx): In PLUS -> IOR simplification
+       pass VOIDmode as op0_mode to recursive call.
+
        2011-05-27  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/49165
index 9e453ec74d7fee7838ad64b33acc8e9455564e68..06e5216f1cec17cf71cfa0ebb1570a2f1b78f94a 100644 (file)
@@ -5298,7 +5298,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest)
        {
          /* Try to simplify the expression further.  */
          rtx tor = simplify_gen_binary (IOR, mode, XEXP (x, 0), XEXP (x, 1));
-         temp = combine_simplify_rtx (tor, mode, in_dest);
+         temp = combine_simplify_rtx (tor, VOIDmode, in_dest);
 
          /* If we could, great.  If not, do not go ahead with the IOR
             replacement, since PLUS appears in many special purpose
index d259fd59d2b6d6732156674a4cbd857d36194a61..7f7e9952ca76904638cb160d6cb39d4cd4680dca 100644 (file)
@@ -1,6 +1,11 @@
 2011-07-19  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from mainline
+       2011-07-04  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/49619
+       * gcc.dg/pr49619.c: New test.
+
        2011-05-27  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/49165
diff --git a/gcc/testsuite/gcc.dg/pr49619.c b/gcc/testsuite/gcc.dg/pr49619.c
new file mode 100644 (file)
index 0000000..d0a72a6
--- /dev/null
@@ -0,0 +1,13 @@
+/* PR rtl-optimization/49619 */
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-fre" } */
+
+extern int a, b;
+
+void
+foo (int x)
+{
+  a = 2;
+  b = 0;
+  b = (a && ((a = 1, 0 >= b) || (short) (x + (b & x))));
+}