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.

On Tue, Nov 5, 2013 at 5:30 PM, Rafael EspĂ­ndola <[email protected]
> wrote:

> The test passes even with the code change reverted.
>
> On 5 November 2013 16:54, Nick Lewycky <[email protected]> wrote:
> > When lowering "cond ? X : Y" we do some safety checks to see whether we
> can
> > instead emit both X and Y and use a llvm select instruction to choose
> > between them. This code is insufficiently safe, and introducing loads
> into a
> > program that didn't load is a bad idea. For example, it could be TLS. It
> > could be a non-volatile auto in another function that isn't the current
> > function (think lambdas).
> >
> > Don't do this here. LLVM knows how to do this properly.
> >
> > Patch attached, please review!
> >
> > Nick
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > [email protected]
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> >
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to