https://gcc.gnu.org/g:8cae7cc099f533b2882898dc05528fcbb70ea9f2
commit r16-2658-g8cae7cc099f533b2882898dc05528fcbb70ea9f2 Author: Richard Biener <rguent...@suse.de> Date: Wed Jul 30 15:05:19 2025 +0200 Disallow scan-store vectorization in epilogues The following disallows vectorizing epilogues containing scan-stores. Since code generation works by walking gimple stmts it is not ready for this when cleaning up epilogue vectorization. I believe scan-store vectorization needs most of the work done during SLP discovery to reflect the data flow. * tree-vect-stmts.cc (check_scan_store): Remove redundant slp_node check. Disallow epilogue vectorization. Diff: --- gcc/tree-vect-stmts.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 88a12a1e3189..47a6b6c55893 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -7098,13 +7098,14 @@ check_scan_store (vec_info *vinfo, stmt_vec_info stmt_info, tree vectype, tree ref_type; gcc_assert (STMT_VINFO_SIMD_LANE_ACCESS_P (stmt_info) > 1); - if ((slp_node && SLP_TREE_LANES (slp_node) > 1) + if (SLP_TREE_LANES (slp_node) > 1 || mask || memory_access_type != VMAT_CONTIGUOUS || TREE_CODE (DR_BASE_ADDRESS (dr_info->dr)) != ADDR_EXPR || !VAR_P (TREE_OPERAND (DR_BASE_ADDRESS (dr_info->dr), 0)) || loop_vinfo == NULL || LOOP_VINFO_FULLY_MASKED_P (loop_vinfo) + || LOOP_VINFO_EPILOGUE_P (loop_vinfo) || STMT_VINFO_GROUPED_ACCESS (stmt_info) || !integer_zerop (get_dr_vinfo_offset (vinfo, dr_info)) || !integer_zerop (DR_INIT (dr_info->dr))