[PATCH] D50979: Eliminate instances of `EmitScalarExpr(E->getArg(n))` in EmitX86BuiltinExpr().

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 20 12:08:23 PDT 2018


thakis added a comment.

In https://reviews.llvm.org/D50979#1206211, @rsmith wrote:

> I don't think this is NFC. Testcase:
>
>   long long int a, b, c, d;
>   unsigned char f() { return _InterlockedCompareExchange128(&(++a), ++b, ++c, &(++d)); }
>
>
> Today, Clang increments `a`, `b`, `c`, and `d` twice each in `f()`.


Thanks for pointing this out, good to hear that this even happens to find a bug :-) I'll add some tests to document the progression.


https://reviews.llvm.org/D50979





More information about the cfe-commits mailing list