From: Jakub Jelinek Date: Tue, 19 Jul 2011 12:58:54 +0000 (+0200) Subject: backport: re PR rtl-optimization/49619 (ICE in simplify_subreg, at simplify-rtx.c... X-Git-Tag: releases/gcc-4.5.4~526 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a276181f2096c4b4fcd43bf5de02e3ec113f4cd;p=thirdparty%2Fgcc.git backport: re PR rtl-optimization/49619 (ICE in simplify_subreg, at simplify-rtx.c:5362) Backport from mainline 2011-07-04 Jakub Jelinek 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 10977031214d..a0fa492467a6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,12 @@ 2011-07-19 Jakub Jelinek Backport from mainline + 2011-07-04 Jakub Jelinek + + 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 PR c++/49165 diff --git a/gcc/combine.c b/gcc/combine.c index 9e453ec74d7f..06e5216f1cec 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d259fd59d2b6..7f7e9952ca76 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,11 @@ 2011-07-19 Jakub Jelinek Backport from mainline + 2011-07-04 Jakub Jelinek + + PR rtl-optimization/49619 + * gcc.dg/pr49619.c: New test. + 2011-05-27 Jakub Jelinek PR c++/49165 diff --git a/gcc/testsuite/gcc.dg/pr49619.c b/gcc/testsuite/gcc.dg/pr49619.c new file mode 100644 index 000000000000..d0a72a6edd19 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr49619.c @@ -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)))); +}