Hello! We have to match input and output operand (or use "+") of an empty asm to move the value to a register.
2017-05-02 Uros Bizjak <ubiz...@gmail.com> * g++.dg/lto/pr79671_0.C (foo): Fix asm constraints. Tested on alphaev68-linux-gnu (where the unpatched testcase fails) and x86_64-linux-gnu. OK for mailine? Uros.
Index: g++.dg/lto/pr79671_0.C =================================================================== --- g++.dg/lto/pr79671_0.C (revision 247497) +++ g++.dg/lto/pr79671_0.C (working copy) @@ -13,7 +13,7 @@ int __attribute__((noinline)) foo() new (&x) B (0); y = x; B *q = reinterpret_cast <B *>(&y); - asm volatile ("" : "=r" (q) : "r" (q)); + asm volatile ("" : "+r" (q)); return q->i; } extern "C" void bar ();