<div dir="ltr">The corresponding C++ test fails without this change. In C, the lvalue-to-rvalue conversion is inside the arms of the ?:, not outside, so the optimization/miscompile never fires.<br><div class="gmail_extra">
<br><div class="gmail_quote">On Tue, Nov 5, 2013 at 5:30 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The test passes even with the code change reverted.<br>
<div><div class="h5"><br>
On 5 November 2013 16:54, Nick Lewycky <<a href="mailto:nlewycky@google.com">nlewycky@google.com</a>> wrote:<br>
> When lowering "cond ? X : Y" we do some safety checks to see whether we can<br>
> instead emit both X and Y and use a llvm select instruction to choose<br>
> between them. This code is insufficiently safe, and introducing loads into a<br>
> program that didn't load is a bad idea. For example, it could be TLS. It<br>
> could be a non-volatile auto in another function that isn't the current<br>
> function (think lambdas).<br>
><br>
> Don't do this here. LLVM knows how to do this properly.<br>
><br>
> Patch attached, please review!<br>
><br>
> Nick<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
><br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>