]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix possible segfault in load/store-lane analysis
authorRichard Biener <rguenther@suse.de>
Thu, 23 Oct 2025 08:54:48 +0000 (10:54 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 23 Oct 2025 10:57:20 +0000 (12:57 +0200)
The following fixes a segfault that appeared with a patch applying
additional permutes to a reduction SLP instance root.

* tree-vect-loop.cc (vect_analyze_loop_2): Deal with NULL
element in SLP_TREE_SCALAR_STMTS.

gcc/tree-vect-loop.cc

index 9320bf8e878d22faa5e202311649ffc05dbd6094..bc01e12f05bc3cebe5e10535355e5ef1d3b4bd56 100644 (file)
@@ -2598,7 +2598,7 @@ again:
 
       stmt_vec_info vinfo;
       vinfo = SLP_TREE_SCALAR_STMTS (SLP_INSTANCE_TREE (instance))[0];
-      if (! STMT_VINFO_GROUPED_ACCESS (vinfo))
+      if (!vinfo || !STMT_VINFO_GROUPED_ACCESS (vinfo))
        continue;
       vinfo = DR_GROUP_FIRST_ELEMENT (vinfo);
       unsigned int size = DR_GROUP_SIZE (vinfo);