Message ID | 87lhcn6gn4.fsf@e105548-lin.cambridge.arm.com |
---|---|
State | New |
Headers | show |
On 09/03/2015 02:39 AM, Richard Sandiford wrote: > > It sounds like Jeff has a much more radical rewrite in mind, Certainly not anything on the immediate horizon. The amount of block copying that'd be needed to isolate the jump threading path would be significant. I do wonder if we should be looking at a way to mark paths which have jump threading opportunities, but which we do not optimize and exploit that information in the uninit and other analysis. Bodik had a paper on those concepts as well. He was mostly looking at how to account for those paths in code coverage analysis, but there may be something useful in there. > so for now how about just turning -Wmaybe-uninitialized into > a warning for this function? The patch will mean that it becomes > 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). Tested that clang could still compile the file. > OK to install? > > > gcc/ > * reload1.c (elimination_costs_in_insn): Locally turn > -Wmaybe-uninitialized into a warning. I can live with this. Though I'd appreciate it if someone could reduce the sparcv9 testcase and create a bug to track it too. jeff
Jeff Law <law@redhat.com> writes: > On 09/03/2015 02:39 AM, Richard Sandiford wrote: >> so for now how about just turning -Wmaybe-uninitialized into >> a warning for this function? The patch will mean that it becomes >> 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). Tested that clang could still compile the file. >> OK to install? >> >> >> gcc/ >> * reload1.c (elimination_costs_in_insn): Locally turn >> -Wmaybe-uninitialized into a warning. > I can live with this. Though I'd appreciate it if someone could reduce > the sparcv9 testcase and create a bug to track it too. Applied, thanks. Richard
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.