]> 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 19:32:12 +0000 (21:32 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 19 Jul 2011 19:32:12 +0000 (21:32 +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: r176485

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

index ceede27601ca194b78cfb431ca44a721559c1bec..f653e9405855388b1f42a6782e3afdfd02820e4d 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 42a465ecc58ed3c82d8c140043015970ce00f8fc..d1ee51c848329a87f27a1200de1ffa474abef703 100644 (file)
@@ -4983,7 +4983,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 153a20c6d3e2bcabfa25e3a4319466eed619aea0..4c256de8369f32d130dc30011a4ef13b49f891a3 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))));
+}