[LLVMdev] Build Failure

Krzysztof Parzyszek kparzysz at codeaurora.org
Thu Jan 3 06:52:39 PST 2013

On 1/2/2013 10:37 PM, greened at obbligato.org wrote:
> Chandler Carruth <chandlerc at google.com> writes:
>> but the fix to silence GCC's -Wuninitialized false positives actively
>> degrades the quality of the code -- it forces dead stores to
>> variables. These dead stores are a waste and prevent tools like
>> Valgrind from finding very real bugs in the logic which cause a
>> variable to be left uninitialized.
> 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.

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.


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation

More information about the llvm-dev mailing list