<div style="font-family: arial, helvetica, sans-serif"><font size="2"><div class="gmail_quote">On Mon, Jun 18, 2012 at 3:21 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Mon, Jun 18, 2012 at 9:19 AM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:<br>
> On Mon, Jun 18, 2012 at 8:37 AM, Duncan Sands <<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>> wrote:<br>
>><br>
>> Hi Chandler,<br>
>><br>
>> > The codebase already has piles of these incorrect warnings in it,<br>
>><br>
>> maybe clang does but LLVM proper does not, so why not keep it that way?<br>
><br>
><br>
> Because the warning is broken. Fundamentally.<br>
><br>
> There is no way to work around the warning that does not make the code<br>
> worse. If the GCC optimizer cannot *prove* that the value is initialized, or<br>
> does not hit one of its magical "don't warn on this" signals (usually<br>
> escaped address to an external function), it calls it uninitialized.<br>
><br>
> If you initialize it blindly, then any actual bug you might have in your<br>
> code will fail to be reported by Valgrind and other tools that really can<br>
> detect uninitialized uses.<br>
><br>
> Now, maybe I've introduced a bug into this code and the warning is<br>
> legitimate. I'll look into that.<br>
<br>
</div>I believe it's this:<br>
<br>
diff --git include/llvm/ADT/DenseMap.h include/llvm/ADT/DenseMap.h<br>
index 045b5c6..0166228 100644<br>
--- include/llvm/ADT/DenseMap.h<br>
+++ include/llvm/ADT/DenseMap.h<br>
@@ -490,7 +490,7 @@ private:<br>
<br>
template <typename LookupKeyT><br>
<div class="im"> bool LookupBucketFor(const LookupKeyT &Val, BucketT *&FoundBucket) {<br>
- const BucketT *ConstFoundBucket = FoundBucket;<br>
</div>+ const BucketT *ConstFoundBucket;<br></blockquote><div><br></div><div>I misread this about 10 times thinking this was part of the diff of this patch...</div><div><br></div><div>I see now that this your proposed *fix* for the warning. Sure, LGTM. This at least doesn't *hide* any bad behavior unlike other cases of this warning....</div>
</div></font></div>