diff options
author | Richard Biener <rguenther@suse.de> | 2021-10-12 13:49:39 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-10-12 14:49:44 +0200 |
commit | d1dcaa31453fa080a27938b064e53f02272d4aa1 (patch) | |
tree | 7226683e686713787e8ef4394e6c565e5c89063b /gcc | |
parent | 9f12a45ef147e563f099c24c293830727e8204cc (diff) | |
download | gcc-d1dcaa31453fa080a27938b064e53f02272d4aa1.zip gcc-d1dcaa31453fa080a27938b064e53f02272d4aa1.tar.gz gcc-d1dcaa31453fa080a27938b064e53f02272d4aa1.tar.bz2 |
tree-optimization/102696 - fix SLP discovery for failed BIT_FIELD_REF
This fixes a forgotten adjustment of matches[] when we fail SLP
discovery.
2021-10-12 Richard Biener <rguenther@suse.de>
PR tree-optimization/102696
* tree-vect-slp.c (vect_build_slp_tree_2): Properly mark
the tree fatally failed when we reject a BIT_FIELD_REF.
* g++.dg/vect/pr102696.cc: New testcase.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/g++.dg/vect/pr102696.cc | 16 | ||||
-rw-r--r-- | gcc/tree-vect-slp.c | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/vect/pr102696.cc b/gcc/testsuite/g++.dg/vect/pr102696.cc new file mode 100644 index 0000000..5560354 --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/pr102696.cc @@ -0,0 +1,16 @@ +// { dg-do compile } +// { dg-additional-options "-O3" } +// { dg-additional-options "-march=skylake-avx512" { target x86_64-*-* i?86-*-* } } + +int a; +extern bool b[][14]; +char h; +void f(short g[][14]) +{ + for (short d = h; d < 21; d += 1) + for (unsigned char e = 0; e < 14; e += 1) + { + a = 0; + b[d][e] = g[d][e]; + } +} diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index c70d06e..709bcb6 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1761,6 +1761,7 @@ vect_build_slp_tree_2 (vec_info *vinfo, slp_tree node, bit_field_size (bfref), &lane)) { lperm.release (); + matches[0] = false; return NULL; } lperm.safe_push (std::make_pair (0, (unsigned)lane)); |