]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
middle-end: Fix ICE in poly-int.h due to SLP.
authorRichard Ball <richard.ball@arm.com>
Thu, 1 Feb 2024 17:18:28 +0000 (17:18 +0000)
committerRichard Biener <rguenther@suse.de>
Wed, 8 May 2024 12:07:29 +0000 (14:07 +0200)
Adds a check to ensure that the input vector arguments
to a function are not variable length. Previously, only the
output vector of a function was checked.

The ICE in question is within the neon-sve-bridge.c test,
and is related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111268

gcc/ChangeLog:
PR tree-optimization/111268
* tree-vect-slp.cc (vectorizable_slp_permutation_1):
Add variable-length check for vector input arguments
to a function.

(cherry picked from commit 4571b4d413a4ba5f1e2d429a2623180ad1c73c0f)

gcc/tree-vect-slp.cc

index 570edf38ca4097333a8192bc57c436655466b735..bbc05fac65ece87c4f0d445029a35facfe81883c 100644 (file)
@@ -8574,7 +8574,8 @@ vectorizable_slp_permutation_1 (vec_info *vinfo, gimple_stmt_iterator *gsi,
     {
       /* Calculate every element of every permute mask vector explicitly,
         instead of relying on the pattern described above.  */
-      if (!nunits.is_constant (&npatterns))
+      if (!nunits.is_constant (&npatterns)
+         || !TYPE_VECTOR_SUBPARTS (op_vectype).is_constant ())
        return -1;
       nelts_per_pattern = ncopies = 1;
       if (loop_vec_info linfo = dyn_cast <loop_vec_info> (vinfo))