From: Richard Biener Date: Fri, 12 Jul 2019 14:36:50 +0000 (+0000) Subject: re PR tree-optimization/91145 (ICE: in vect_build_slp_tree_2, at tree-vect-slp.c... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cf91b5997dec281e4b784c163d76d5be3e8569f6;p=gcc.git re PR tree-optimization/91145 (ICE: in vect_build_slp_tree_2, at tree-vect-slp.c:1143 with -march=skylake-avx512 -O3) 2019-07-12 Richard Biener PR tree-optimization/91145 * tree-vect-slp.c (vect_build_slp_tree_2): Fix reduction chain check. * gcc.dg/torture/pr91145.c: New testcase. From-SVN: r273445 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2d1d29f005c..84fee9e0dd9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-07-12 Richard Biener + + PR tree-optimization/91145 + * tree-vect-slp.c (vect_build_slp_tree_2): Fix reduction + chain check. + 2019-07-12 Alexandre Oliva * tree-eh.c (honor_protect_cleanup_actions): Use outer_ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index debec92a89f..e948a715679 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,7 +1,11 @@ +2019-07-12 Richard Biener + + PR tree-optimization/91145 + * gcc.dg/torture/pr91145.c: New testcase. + 2019-07-12 Alexandre Oliva * gcc.dg/gimplefe-44.c: New. - * gcc.dg/gimplefe-43.c: New. 2019-07-12 Richard Biener diff --git a/gcc/testsuite/gcc.dg/torture/pr91145.c b/gcc/testsuite/gcc.dg/torture/pr91145.c new file mode 100644 index 00000000000..7d62ad11faf --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr91145.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=skylake-avx512" { target x86_64-*-* i?86-*-* } } */ + +int a, c; +unsigned b, e; +extern unsigned d[100]; + +void f() +{ + for (int g = 0; g < 70; g++) + { + + b += d[g] - c; + e -= g ^ a; + } +} diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index d172c3a75ae..31f4519ff5a 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1140,7 +1140,8 @@ vect_build_slp_tree_2 (vec_info *vinfo, FOR_EACH_VEC_ELT (stmts, i, other_info) { /* But for reduction chains only check on the first stmt. */ - if (REDUC_GROUP_FIRST_ELEMENT (other_info) + if (!STMT_VINFO_DATA_REF (other_info) + && REDUC_GROUP_FIRST_ELEMENT (other_info) && REDUC_GROUP_FIRST_ELEMENT (other_info) != stmt_info) continue; if (STMT_VINFO_DEF_TYPE (other_info) != def_type)