]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/116810 - out-of-bound access to matches[]
authorRichard Biener <rguenther@suse.de>
Mon, 23 Sep 2024 08:30:32 +0000 (10:30 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 23 Sep 2024 10:52:12 +0000 (12:52 +0200)
The following makes sure to apply forced splitting of groups for
firced single-lane SLP only when the group being analyzed has more
than one lane.  This avoids an out-of-bound access to matches[].

PR tree-optimization/116810
* tree-vect-slp.cc (vect_build_slp_instance): Onlu force
splitting for group_size > 1.

gcc/tree-vect-slp.cc

index 7161492f5114ddb589ada700e5cd91a29627eba0..ab49bb0e7ee126c9be7a7d266c7cf69e5fbcbdeb 100644 (file)
@@ -3715,7 +3715,7 @@ vect_build_slp_instance (vec_info *vinfo,
   unsigned i;
 
   slp_tree node = NULL;
-  if (force_single_lane)
+  if (group_size > 1 && force_single_lane)
     {
       matches[0] = true;
       matches[1] = false;