[gcc(refs/vendors/vrull/heads/slp-improvements)] Fix memory corruption when group_size is not a multiple of 4

Philipp Tomsich ptomsich@gcc.gnu.org
Wed Jan 17 19:14:20 GMT 2024


https://gcc.gnu.org/g:a69c964f1616df393295f3643f5edd5f54d3c830

commit a69c964f1616df393295f3643f5edd5f54d3c830
Author: Manolis Tsamis <manolis.tsamis@vrull.eu>
Date:   Thu Nov 23 11:28:15 2023 +0100

    Fix memory corruption when group_size is not a multiple of 4
    
    Ref #342

Diff:
---
 gcc/tree-vect-slp.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 761c1ed3608..58543629756 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -1827,7 +1827,7 @@ try_rearrange_oprnd_info (vec<slp_oprnd_info> &oprnds_info, unsigned group_size)
   slp_oprnd_info oprnd_info;
 
   /* A more generalized version is WIP but this is generic enough anyway.  */
-  if (oprnds_info.length() != 2 || group_size < 4)
+  if (oprnds_info.length() != 2 || group_size % 4 != 0)
     return 0;
 
   FOR_EACH_VEC_ELT (oprnds_info, i, oprnd_info)


More information about the Gcc-cvs mailing list