From: rsandifo Date: Thu, 10 Sep 2015 19:17:24 +0000 (+0000) Subject: Stop reload1.c warning from breaking bootstrap X-Git-Tag: upstream/6.1~4784 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d593d76a8d716cd3a022c7185fe9542ee094a15;p=platform%2Fupstream%2Flinaro-gcc.git Stop reload1.c warning from breaking bootstrap Some host-target combinations get bogus warnings about orig_dup being used uninitialized. I tried to coerce the current uninit pass to handle this case, but the patch I ended up with only worked by accident because of the strange way in which the pass handles limit cases. (If we have more than MAX_NUM_CHAINS chains, it silently drops the excess chains and continues regardless, so it's quite easy to come up with cases where the predicates for either the definition or the use consider an arbitrary subset of the actual conditions.) For now this patch turns -Wmaybe-uninitialized into a warning for the affacted function. It will be a warning even if someone turns off warnings on the command line, but I don't think that's important. Bootstrapped and regression-tested on x86_64-linux-gnu. Also tested with a cross-compiler to sparc-linux-gnu (which also triggered the warning for me). gcc/ * reload1.c (elimination_costs_in_insn): Locally turn -Wmaybe-uninitialized into a warning. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227658 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4831e7f..a9a6fbd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-09-10 Richard Sandiford + + * reload1.c (elimination_costs_in_insn): Locally turn + -Wmaybe-uninitialized into a warning. + 2015-09-10 Segher Boessenkool * shrink-wrap.c (requires_stack_frame_p): Make static. diff --git a/gcc/reload1.c b/gcc/reload1.c index ad243e3..c7cc37b 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -3636,6 +3636,8 @@ eliminate_regs_in_insn (rtx_insn *insn, int replace) eliminations in its operands and record cases where eliminating a reg with an invariant equivalence would add extra cost. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-Wmaybe-uninitialized" static void elimination_costs_in_insn (rtx_insn *insn) { @@ -3785,6 +3787,7 @@ elimination_costs_in_insn (rtx_insn *insn) return; } +#pragma GCC diagnostic pop /* Loop through all elimination pairs. Recalculate the number not at initial offset.