From: Richard Biener Date: Tue, 8 Dec 2020 08:56:53 +0000 (+0100) Subject: tree-optimization/98191 - fix BIT_INSERT_EXPR sequence vectorization X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c2c198bfd1e747b761c6b9b13417685bd4378d57;p=gcc.git tree-optimization/98191 - fix BIT_INSERT_EXPR sequence vectorization This adds a missing check. 2020-12-08 Richard Biener PR tree-optimization/98191 * tree-vect-slp.c (vect_slp_check_for_constructors): Do not follow a non-SSA def chain. * gcc.dg/torture/pr98191.c: New testcase. --- diff --git a/gcc/testsuite/gcc.dg/torture/pr98191.c b/gcc/testsuite/gcc.dg/torture/pr98191.c new file mode 100644 index 00000000000..93cd27c21e1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr98191.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ + +typedef double v2df __attribute__((vector_size(2*sizeof(double)))); + +v2df foo (double *y) +{ + v2df x = (v2df){ 1.0, 2.0 }; + x[0] = *y; + return x; +} diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index a2757e707ff..35e783505b4 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -4243,7 +4243,8 @@ vect_slp_check_for_constructors (bb_vec_info bb_vinfo) def = gimple_assign_rhs1 (assign); do { - if (!has_single_use (def)) + if (TREE_CODE (def) != SSA_NAME + || !has_single_use (def)) break; gimple *def_stmt = SSA_NAME_DEF_STMT (def); unsigned this_lane;