This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix uninitialised variable warning in tree-ssa-loop-ivcanon.c
- From: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 17 Apr 2014 17:43:40 +0100
- Subject: [PATCH] Fix uninitialised variable warning in tree-ssa-loop-ivcanon.c
- Authentication-results: sourceware.org; auth=none
Hi all,
While looking at the build logs I noticed a warning while building tree-ssa-loop-ivcanon.c about a potential use of an uninitialised variable.
This patchlet fixes that warning by initialising it to 0.
Tested arm-none-eabi.
Ok for trunk?
2014-04-17 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
Initialise n_unroll to 0.
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index cdf1559..7a83b12 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -656,7 +656,7 @@ try_unroll_loop_completely (struct loop *loop,
HOST_WIDE_INT maxiter,
location_t locus)
{
- unsigned HOST_WIDE_INT n_unroll, ninsns, max_unroll, unr_insns;
+ unsigned HOST_WIDE_INT n_unroll = 0, ninsns, max_unroll, unr_insns;
gimple cond;
struct loop_size size;
bool n_unroll_found = false;