From: Richard Sandiford Date: Thu, 13 Aug 2015 20:22:34 +0000 (+0000) Subject: re PR middle-end/55035 (reload1.c:3766:41: error: ‘orig_dup[0]’ may be used uninitial... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9016329382f7824f7a9f5b7198ff47327797bbdf;p=gcc.git re PR middle-end/55035 (reload1.c:3766:41: error: ‘orig_dup[0]’ may be used uninitialized in this function (for fr30, microblaze, moxie, rl78)) gcc/ PR bootstrap/55035 * reload1.c (elimination_costs_in_insn): Make it obvious to the compiler that the n_dups and n_operands loop bounds are invariant. From-SVN: r226874 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f3262e5452e..b8568bc0b8b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-08-13 Richard Sandiford + + PR bootstrap/55035 + * reload1.c (elimination_costs_in_insn): Make it obvious to the + compiler that the n_dups and n_operands loop bounds are invariant. + 2015-08-13 Kyrylo Tkachov * ifcvt.c (noce_try_store_flag_constants): Handle PLUS-immediate diff --git a/gcc/reload1.c b/gcc/reload1.c index ce06e0696e4..ad243e321d1 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -3708,10 +3708,12 @@ elimination_costs_in_insn (rtx_insn *insn) /* Eliminate all eliminable registers occurring in operands that can be handled by reload. */ extract_insn (insn); - for (i = 0; i < recog_data.n_dups; i++) + int n_dups = recog_data.n_dups; + for (i = 0; i < n_dups; i++) orig_dup[i] = *recog_data.dup_loc[i]; - for (i = 0; i < recog_data.n_operands; i++) + int n_operands = recog_data.n_operands; + for (i = 0; i < n_operands; i++) { orig_operand[i] = recog_data.operand[i]; @@ -3756,7 +3758,7 @@ elimination_costs_in_insn (rtx_insn *insn) } } - for (i = 0; i < recog_data.n_dups; i++) + for (i = 0; i < n_dups; i++) *recog_data.dup_loc[i] = *recog_data.operand_loc[(int) recog_data.dup_num[i]]; @@ -3764,9 +3766,9 @@ elimination_costs_in_insn (rtx_insn *insn) check_eliminable_occurrences (old_body); /* Restore the old body. */ - for (i = 0; i < recog_data.n_operands; i++) + for (i = 0; i < n_operands; i++) *recog_data.operand_loc[i] = orig_operand[i]; - for (i = 0; i < recog_data.n_dups; i++) + for (i = 0; i < n_dups; i++) *recog_data.dup_loc[i] = orig_dup[i]; /* Update all elimination pairs to reflect the status after the current