vect: Init inside_cost in vect_model_reduction_cost
authorKewen Lin <linkw@linux.ibm.com>
Thu, 25 Mar 2021 12:53:06 +0000 (07:53 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Thu, 25 Mar 2021 12:58:24 +0000 (07:58 -0500)
This patch is to initialize the inside_cost as zero, can avoid
to use its uninitialized value when some path doesn't assign it.

gcc/ChangeLog:

* tree-vect-loop.c (vect_model_reduction_cost): Init inside_cost.

gcc/tree-vect-loop.c

index 3e973e7..38d96fc 100644 (file)
@@ -4465,7 +4465,7 @@ vect_model_reduction_cost (loop_vec_info loop_vinfo,
                           vect_reduction_type reduction_type,
                           int ncopies, stmt_vector_for_cost *cost_vec)
 {
-  int prologue_cost = 0, epilogue_cost = 0, inside_cost;
+  int prologue_cost = 0, epilogue_cost = 0, inside_cost = 0;
   enum tree_code code;
   optab optab;
   tree vectype;