aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-09-23 10:30:32 +0200
committerRichard Biener <rguenth@gcc.gnu.org>2024-09-23 12:52:12 +0200
commit2c04f175de4f3985d783511662375d52f2cf4ad8 (patch)
treec3ff6b608b54b11717dbf7a04c78489a5219145d
parente97c75d668bacd8a2e901b819e00156f6e9f4c6c (diff)
downloadgcc-2c04f175de4f3985d783511662375d52f2cf4ad8.zip
gcc-2c04f175de4f3985d783511662375d52f2cf4ad8.tar.gz
gcc-2c04f175de4f3985d783511662375d52f2cf4ad8.tar.bz2
tree-optimization/116810 - out-of-bound access to matches[]
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.
-rw-r--r--gcc/tree-vect-slp.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 7161492..ab49bb0 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -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;