diff options
author | Ilya Enkovich <ilya.enkovich@intel.com> | 2016-05-27 10:39:40 +0000 |
---|---|---|
committer | Ilya Enkovich <ienkovich@gcc.gnu.org> | 2016-05-27 10:39:40 +0000 |
commit | 0561bcfb825ec512375f06c5b2199d44263832cb (patch) | |
tree | 5436917315ba35f5e09a65233c0b8523e5e663b7 /gcc | |
parent | 2aca2504814648927ab560f75e564b69835e0514 (diff) | |
download | gcc-0561bcfb825ec512375f06c5b2199d44263832cb.zip gcc-0561bcfb825ec512375f06c5b2199d44263832cb.tar.gz gcc-0561bcfb825ec512375f06c5b2199d44263832cb.tar.bz2 |
re PR middle-end/71279 (ICE on trunk gcc with knl target)
gcc/
PR middle-end/71279
* fold-const.c (fold_ternary_loc): Don't fold VEC_COND_EXPR
into comparison.
gcc/testsuite/
PR middle-end/71279
* gcc.dg/pr71279.c: New test.
From-SVN: r236810
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fold-const.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr71279.c | 14 |
4 files changed, 28 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fd03e8c..b598a4e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-05-27 Ilya Enkovich <ilya.enkovich@intel.com> + + PR middle-end/71279 + * fold-const.c (fold_ternary_loc): Don't fold VEC_COND_EXPR + into comparison. + 2016-05-27 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/aarch64/aarch64-modes.def (CC_ZESWP, CC_SESWP): Delete. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 556fc73..5058746 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -11515,9 +11515,9 @@ fold_ternary_loc (location_t loc, enum tree_code code, tree type, /* Convert A ? 0 : 1 to !A. This prefers the use of NOT_EXPR over COND_EXPR in cases such as floating point comparisons. */ if (integer_zerop (op1) - && (code == VEC_COND_EXPR ? integer_all_onesp (op2) - : (integer_onep (op2) - && !VECTOR_TYPE_P (type))) + && code == COND_EXPR + && integer_onep (op2) + && !VECTOR_TYPE_P (type) && truth_value_p (TREE_CODE (arg0))) return pedantic_non_lvalue_loc (loc, fold_convert_loc (loc, type, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f046e40..a959325 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-05-27 Ilya Enkovich <ilya.enkovich@intel.com> + + PR middle-end/71279 + * gcc.dg/pr71279.c: New test. + 2016-05-26 Michael Meissner <meissner@linux.vnet.ibm.com> * gcc.target/powerpc/p9-minmax-1.c: New tests for ISA 3.0 diff --git a/gcc/testsuite/gcc.dg/pr71279.c b/gcc/testsuite/gcc.dg/pr71279.c new file mode 100644 index 0000000..4ecc84b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr71279.c @@ -0,0 +1,14 @@ +/* PR middle-end/71279 */ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ +/* { dg-additional-options "-march=knl" { target { i?86-*-* x86_64-*-* } } } */ + +extern int a, b; +long c[1][1][1]; +long d[1][1]; + +void fn1 () +{ + for (int e = 0; e < b; e = e + 1) + *(e + **c) = (a && *d[1]) - 1; +} |