From 9016329382f7824f7a9f5b7198ff47327797bbdf Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 13 Aug 2015 20:22:34 +0000 Subject: [PATCH] =?utf8?q?re=20PR=20middle-end/55035=20(reload1.c:3766:41:?= =?utf8?q?=20error:=20=E2=80=98orig=5Fdup[0]=E2=80=99=20may=20be=20used=20?= =?utf8?q?uninitialized=20in=20this=20function=20(for=20fr30,=20microblaze?= =?utf8?q?,=20moxie,=20rl78))?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- gcc/ChangeLog | 6 ++++++ gcc/reload1.c | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) 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 -- 2.30.2