aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-11-06 09:35:27 +0100
committerRichard Biener <rguenther@suse.de>2020-11-06 11:10:23 +0100
commit8ebedfcd86aa5e3fc902fb442ce12c9d440c23c8 (patch)
treefc165f379cd0ebcd1c2f4097a8676a535e941f42 /gcc/gimple-fold.c
parentf11b1f9d155bcbd797d0cb06bee2825c70ba9dd4 (diff)
downloadgcc-8ebedfcd86aa5e3fc902fb442ce12c9d440c23c8.zip
gcc-8ebedfcd86aa5e3fc902fb442ce12c9d440c23c8.tar.gz
gcc-8ebedfcd86aa5e3fc902fb442ce12c9d440c23c8.tar.bz2
tree-optimization/97732 - fix init of SLP induction vectorization
This PR exposes two issues - one that the vector builder treats &x as eligible for VECTOR_CST elements and one that SLP induction vectorization forgets to convert init elements to the vector component type which makes a difference for pointer vs. integer. 2020-11-06 Richard Biener <rguenther@suse.de> PR tree-optimization/97732 * tree-vect-loop.c (vectorizable_induction): Convert the init elements to the vector component type. * gimple-fold.c (gimple_build_vector): Use CONSTANT_CLASS_P rather than TREE_CONSTANT to determine if elements are eligible for VECTOR_CSTs. * gcc.dg/vect/bb-slp-pr97732.c: New testcase.
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r--gcc/gimple-fold.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index c3fa4cb..ca38a31 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -7855,7 +7855,7 @@ gimple_build_vector (gimple_seq *seq, location_t loc,
gcc_assert (builder->nelts_per_pattern () <= 2);
unsigned int encoded_nelts = builder->encoded_nelts ();
for (unsigned int i = 0; i < encoded_nelts; ++i)
- if (!TREE_CONSTANT ((*builder)[i]))
+ if (!CONSTANT_CLASS_P ((*builder)[i]))
{
tree type = builder->type ();
unsigned int nelts = TYPE_VECTOR_SUBPARTS (type).to_constant ();