This is the mail archive of the
mailing list for the GCC project.
Re: Weird warning when building gcc
On 09/23/2017 04:57 PM, Eric Gallager wrote:
> On Sat, Sep 23, 2017 at 12:34 PM, nick <firstname.lastname@example.org> wrote:
>> On 2017-09-23 12:05 PM, Jeff Law wrote:
>>> On 09/22/2017 08:25 PM, nick wrote:
>>>> Greetings All,
>>>> I am wondering if this is a warning worth looking into or is it just another false postive:
>>>> /home/nick/gcc/gcc/combine.c:1316:8: warning: ‘prev’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>>>> if ((next = try_combine (insn, prev, NULL, NULL,
>>>> Maybe it's just me being new to the project but is the code for that literally or also identical between this and the
>>>> one where CC0 register is directly used.
>>> Looks like a false positive to me. Without more details (host, target,
>>> flags, cpp output) I can't be 100% sure why it triggers though.
>>> Flow sensitive warnings such as this are very sensitive to a variety of
>>> low level target and IL details.
>> Thanks specifically what low level details do you need. It's currently on a x86-64 bit ubuntu host.
>> Was build with the stock gcc from the ubuntu 17.04 repos with W=2 for extra warnings. What do these
>> lines do, anything outside of the normal setting marcos as they seem to me:
>> && GET_CODE (PATTERN (insn)) == SET
>> && reg_mentioned_p (cc0_rtx, SET_SRC (PATTERN (insn)))
>> I am wondering what GET_CODE,SET_SRC, PATTERN marcos do plus the function called, reg_mentioned_P?
>> If your able to just tell me where the functions are located or how do you enable ctags for all of
>> gcc? That would just save me asking stupid questions. Is there a global setting like make ctags for
>> doing this or you I have to do it manually.
>> Thanks for the quick response,
> I think I remember running into this warning before; it's because
> stage 1 of bootstrap is built without optimization so the warnings
> don't have as good information.
It's certainly the case that at -O0, -O1 or -Os you'll tend to get more
Each of those throttle back jump threading which is vital to identifying
and eliminating paths through the CFG that can never be executed. And a
false positive -Wuninitialized warning is almost always on a path that
can never be executed.