[LLVMdev] Build Failure
dag at cray.com
dag at cray.com
Thu Jan 3 08:56:52 PST 2013
Krzysztof Parzyszek <kparzysz at codeaurora.org> writes:
>> I'm curious about this statement. Can you give an example? I've
>> committed fixes to lots of -Wuninitialized warnings in my tree. It's
>> all just initializing local variables, which shouldn't result in extra
>> stores.
>
> The logic of the program may be such that the actual store (not the
> "pre-initialization") always happens before any uses, but the compiler
> may be unable to prove it. In such case, the added initialization
> will extend the live range of the object and may result in a register
> spill.
If that's really the case, then the variable is declared much too early
and the declaration should be moved.
> I believe that in the vast majority of cases this is not going to be a
> problem, and the warning is shown because of the basic nature of the
> front-end's analysis.
It's a problem if we keep ignoring warnings and we miss real bugs
because there are so many warning messages that things get lost.
I have fixed several dozen warnings now.
-David
More information about the llvm-dev
mailing list