diff options
author | Hao Liu <hliu@os.amperecomputing.com> | 2023-07-04 17:17:50 +0800 |
---|---|---|
committer | Hao Liu <hliu@os.amperecomputing.com> | 2023-07-04 17:19:23 +0800 |
commit | 2c12ccf800fc7890925402d30a02f0fa9e2627cc (patch) | |
tree | 28df6c269b8fcc5d8f646b74711f2a15a277858f | |
parent | b083203f053f1666e9cc1ded2abdf4e1688d1ec0 (diff) | |
download | gcc-2c12ccf800fc7890925402d30a02f0fa9e2627cc.zip gcc-2c12ccf800fc7890925402d30a02f0fa9e2627cc.tar.gz gcc-2c12ccf800fc7890925402d30a02f0fa9e2627cc.tar.bz2 |
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.
-rw-r--r-- | gcc/tree-vect-loop.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index f39a1ec..e504645 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -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, |