PR tree-optimization/110531 - Vect: avoid using uninitialized variable

slp_done_for_suggested_uf is used directly in vect_analyze_loop_2
without initialization, which is undefined behavior.  Initialize it to false
according to the discussion.

gcc/ChangeLog:
	PR tree-optimization/110531
	* tree-vect-loop.cc (vect_analyze_loop_1): initialize
	slp_done_for_suggested_uf to false.
This commit is contained in:
Hao Liu 2023-07-04 17:17:50 +08:00
parent b083203f05
commit 2c12ccf800

View file

@ -3333,7 +3333,7 @@ vect_analyze_loop_1 (class loop *loop, vec_info_shared *shared,
machine_mode vector_mode = vector_modes[mode_i];
loop_vinfo->vector_mode = vector_mode;
unsigned int suggested_unroll_factor = 1;
bool slp_done_for_suggested_uf;
bool slp_done_for_suggested_uf = false;
/* Run the main analysis. */
opt_result res = vect_analyze_loop_2 (loop_vinfo, fatal,