[Bug rtl-optimization/104236] asm statements containing %= assembler templates getting merged

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 26 01:52:18 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104236

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
You can still use %= if you want and combine it with the input constraint with
counter.
That is:
void y (int a) {
    if (a)
        asm("# %="::"i"(__COUNTER__));
    else
        asm("# %="::"i"(__COUNTER__));
}

That way if you still get the same version to use between the two compilers if
clang does not have __COUNTER__.


More information about the Gcc-bugs mailing list