public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4351] tree-optimization/102696 - fix SLP discovery for failed BIT_FIELD_REF
@ 2021-10-12 12:50 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2021-10-12 12:50 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:d1dcaa31453fa080a27938b064e53f02272d4aa1
commit r12-4351-gd1dcaa31453fa080a27938b064e53f02272d4aa1
Author: Richard Biener <rguenther@suse.de>
Date: Tue Oct 12 13:49:39 2021 +0200
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.
Diff:
---
gcc/testsuite/g++.dg/vect/pr102696.cc | 16 ++++++++++++++++
gcc/tree-vect-slp.c | 1 +
2 files changed, 17 insertions(+)
diff --git a/gcc/testsuite/g++.dg/vect/pr102696.cc b/gcc/testsuite/g++.dg/vect/pr102696.cc
new file mode 100644
index 00000000000..5560354304a
--- /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 c70d06e5f20..709bcb63686 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));
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-12 12:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-12 12:50 [gcc r12-4351] tree-optimization/102696 - fix SLP discovery for failed BIT_FIELD_REF Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).