]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/117050 - fix ICE with non-grouped .MASK_LOAD SLP
authorRichard Biener <rguenther@suse.de>
Thu, 10 Oct 2024 09:02:47 +0000 (11:02 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 11 Oct 2024 07:14:22 +0000 (09:14 +0200)
The following temporarily reverts the support of permuted .MASK_LOAD for the
case of non-grouped accesses.

PR tree-optimization/117050
* tree-vect-slp.cc (vect_build_slp_tree_2): Do not support
permutes of non-grouped .MASK_LOAD.

* gcc.dg/vect/pr117050.c: New testcase.

gcc/testsuite/gcc.dg/vect/pr117050.c [new file with mode: 0644]
gcc/tree-vect-slp.cc

diff --git a/gcc/testsuite/gcc.dg/vect/pr117050.c b/gcc/testsuite/gcc.dg/vect/pr117050.c
new file mode 100644 (file)
index 0000000..7b12cbc
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-mavx2" { target { x86_64-*-* i?86-*-* } } } */
+
+typedef struct {
+  char *data;
+} song_sample_t;
+typedef struct {
+  int right_ramp;
+  int left_ramp;
+} song_voice_t;
+song_sample_t *csf_stop_sample_smp, *csf_stop_sample_v_3;
+song_voice_t *csf_stop_sample_v;
+void csf_stop_sample()
+{
+  for (int i; i; i++, csf_stop_sample_v++)
+    if (csf_stop_sample_v_3 || csf_stop_sample_smp->data)
+      csf_stop_sample_v->left_ramp = csf_stop_sample_v->right_ramp = 0;
+}
index 3024b87a1f835b59d3964b2723c2233b7d5d6df1..914b0b61b4d588dd9d50f75bfe54a8f466a66da1 100644 (file)
@@ -2031,7 +2031,8 @@ vect_build_slp_tree_2 (vec_info *vinfo, slp_tree node,
                 loads with gaps.  */
              if ((STMT_VINFO_GROUPED_ACCESS (stmt_info)
                   && (DR_GROUP_GAP (first_stmt_info) != 0 || has_gaps))
-                 || STMT_VINFO_STRIDED_P (stmt_info))
+                 || STMT_VINFO_STRIDED_P (stmt_info)
+                 || (!STMT_VINFO_GROUPED_ACCESS (stmt_info) && any_permute))
                {
                  load_permutation.release ();
                  matches[0] = false;