From cc3370077c5fec5cd8e36144987e4edbf5c0e3dc Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 17 Mar 2026 13:54:37 +0100 Subject: [PATCH] Fix uninitialized LOOP_VINFO_LOOP_IV_COND With uncounted loop support we can leave LOOP_VINFO_LOOP_IV_COND uninitialized but that's accessed from vect_stmt_relevant_p, unlikely to match by chance, but the following fixes it nevertheless. * tree-vect-loop.cc (_loop_vec_info::_loop_vec_info): Initialize loop_iv_cond given it's no longer always initialized ... (vect_create_loop_vinfo): ... here. Fix formatting. --- gcc/tree-vect-loop.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 890ea3ebb48..7121edb8d81 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -763,6 +763,7 @@ _loop_vec_info::_loop_vec_info (class loop *loop_in, vec_info_shared *shared) peeling_for_gaps (false), peeling_for_niter (false), early_breaks (false), + loop_iv_cond (NULL), user_unroll (false), no_data_dependencies (false), has_mask_store (false), @@ -1693,7 +1694,7 @@ vect_create_loop_vinfo (class loop *loop, vec_info_shared *shared, unsigned cond_id = 0; if (!LOOP_VINFO_NITERS_UNCOUNTED_P (loop_vinfo)) - LOOP_VINFO_LOOP_IV_COND (loop_vinfo) = info->conds[cond_id++]; + LOOP_VINFO_LOOP_IV_COND (loop_vinfo) = info->conds[cond_id++]; for (; cond_id < info->conds.length (); cond_id ++) LOOP_VINFO_LOOP_CONDS (loop_vinfo).safe_push (info->conds[cond_id]);