From: Jakub Jelinek Date: Tue, 19 Jul 2011 19:32:12 +0000 (+0200) Subject: backport: re PR rtl-optimization/49619 (ICE in simplify_subreg, at simplify-rtx.c... X-Git-Tag: releases/gcc-4.4.7~313 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ae304212d35a01ca79ebf2b33de836afab827e7;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: r176485 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ceede27601ca..f653e9405855 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 42a465ecc58e..d1ee51c84832 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 153a20c6d3e2..4c256de8369f 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)))); +}