]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix SLP of emulated gathers
authorRichard Biener <rguenther@suse.de>
Wed, 8 Nov 2023 14:42:16 +0000 (15:42 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 8 Nov 2023 15:35:37 +0000 (16:35 +0100)
The following fixes an error in the SLP of emulated gathers,
discovered by x86 specific tests when enabling single-lane SLP.

* tree-vect-stmts.cc (vectorizable_load): Adjust offset
vector gathering for SLP of emulated gathers.

gcc/tree-vect-stmts.cc

index 61e23b295160c06d2d811367bbf2dabdd09705f9..913a4fb08ed15c9588795b7e5e1e23f1d781a133 100644 (file)
@@ -11163,7 +11163,7 @@ vectorizable_load (vec_info *vinfo,
                     than the data vector for now.  */
                  unsigned HOST_WIDE_INT factor
                    = const_offset_nunits / const_nunits;
-                 vec_offset = vec_offsets[j / factor];
+                 vec_offset = vec_offsets[(vec_num * j + i) / factor];
                  unsigned elt_offset = (j % factor) * const_nunits;
                  tree idx_type = TREE_TYPE (TREE_TYPE (vec_offset));
                  tree scale = size_int (gs_info.scale);