<div dir="rtl"><div dir="ltr">I had not seen any assert failing (build release with assertions) in my use case. </div><div dir="ltr"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2015-10-19 12:34 GMT+03:00 Sanjoy Das via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Did this bug trip manage to trip one of the EpochTracker related<br>
asserts?  EpochTracker is supposed to eagerly catch issues like these<br>
without actually needing the DenseMap resize.<br>
<br>
-- Sanjoy<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Oct 19, 2015 at 1:55 AM, James Molloy via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Author: jamesm<br>
> Date: Mon Oct 19 03:54:59 2015<br>
> New Revision: 250692<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=250692&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=250692&view=rev</a><br>
> Log:<br>
> [GlobalsAA] Fix a really horrible iterator invalidation bug<br>
><br>
> We were keeping a reference to an object in a DenseMap then mutating it. At the end of the function we were attempting to clone that reference into other keys in the DenseMap, but DenseMap may well decide to resize its hashtable which would invalidate the reference!<br>
><br>
> It took an extremely complex testcase to catch this - many thanks to Zhendong Su for catching it in PR25225.<br>
><br>
> This fixes PR25225.<br>
><br>
> Modified:<br>
>     llvm/trunk/lib/Analysis/GlobalsModRef.cpp<br>
><br>
> Modified: llvm/trunk/lib/Analysis/GlobalsModRef.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/GlobalsModRef.cpp?rev=250692&r1=250691&r2=250692&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/GlobalsModRef.cpp?rev=250692&r1=250691&r2=250692&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Analysis/GlobalsModRef.cpp (original)<br>
> +++ llvm/trunk/lib/Analysis/GlobalsModRef.cpp Mon Oct 19 03:54:59 2015<br>
> @@ -587,8 +587,11 @@ void GlobalsAAResult::AnalyzeCallGraph(C<br>
><br>
>      // Finally, now that we know the full effect on this SCC, clone the<br>
>      // information to each function in the SCC.<br>
> +    // FI is a reference into FunctionInfos, so copy it now so that it doesn't<br>
> +    // get invalidated if DenseMap decides to re-hash.<br>
> +    FunctionInfo CachedFI = FI;<br>
>      for (unsigned i = 1, e = SCC.size(); i != e; ++i)<br>
> -      FunctionInfos[SCC[i]->getFunction()] = FI;<br>
> +      FunctionInfos[SCC[i]->getFunction()] = CachedFI;<br>
>    }<br>
>  }<br>
><br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Sanjoy Das<br>
<a href="http://playingwithpointers.com" rel="noreferrer" target="_blank">http://playingwithpointers.com</a><br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>