<div dir="ltr">Absolutely. Thanks for spotting that.</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Mar 16, 2018 at 8:03 PM Tom Stellard via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 03/16/2018 04:51 PM, Chandler Carruth via llvm-commits wrote:<br>
> Author: chandlerc<br>
> Date: Fri Mar 16 16:51:33 2018<br>
> New Revision: 327761<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=327761&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=327761&view=rev</a><br>
<br>
Hi Chandler,<br>
<br>
Is this a candidate for 6.0.1?<br>
<br>
-Tom<br>
<br>
> Log:<br>
> [GlobalsAA] Fix a pretty terrible bug that has been in GlobalsAA for<br>
> a long time.<br>
><br>
> The key thing is that we need to create value handles for every function<br>
> that we create a `FunctionInfo` object around. Without this, when that<br>
> function is deleted we can end up creating a new function that collides<br>
> with its address and look up a stale AA result. With that AA result we<br>
> can in turn miscompile code in ways that break.<br>
><br>
> This is seriously one of the most absurd miscompiles I've seen. It only<br>
> reproduced for us recently and only when building a very large server<br>
> with both ThinLTO and PGO.<br>
><br>
> A *HUGE* shout out to Wei Mi who tracked all of this down and came up<br>
> with this patch. I'm just landing it because I happened to still by at<br>
> a computer.<br>
><br>
> He or I can work on crafting a test case to hit this (now that we know<br>
> what to target) but it'll take a while, and we've been chasing this for<br>
> a long time and need it fix Right Now.<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=327761&r1=327760&r2=327761&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/GlobalsModRef.cpp?rev=327761&r1=327760&r2=327761&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/Analysis/GlobalsModRef.cpp (original)<br>
> +++ llvm/trunk/lib/Analysis/GlobalsModRef.cpp Fri Mar 16 16:51:33 2018<br>
> @@ -502,6 +502,8 @@ void GlobalsAAResult::AnalyzeCallGraph(C<br>
>      }<br>
><br>
>      FunctionInfo &FI = FunctionInfos[F];<br>
> +    Handles.emplace_front(*this, F);<br>
> +    Handles.front().I = Handles.begin();<br>
>      bool KnowNothing = false;<br>
><br>
>      // Collect the mod/ref properties due to called functions.  We only compute<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">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>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">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>
</blockquote></div>