[Bug target/91886] [10 regression] powerpc64 impossible constraint in asm

bugdal at aerifal dot cx gcc-bugzilla@gcc.gnu.org
Thu Nov 7 13:34:00 GMT 2019


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

--- Comment #8 from Rich Felker <bugdal at aerifal dot cx> ---
> Then LLVM has more to fix.  Constraints never look at types.  A register
> constraint (like "wa") simply says what registers are valid.

This is blatently false. For x86:

int foo(int x)
{
    __asm__("" : "+f"(x));
    return x;
}

yields "error: inconsistent operand constraints in an 'asm'".

> For many w* using it in inline asm is plain wrong; for the rest of the
> register constraints it is useless, plain "wa" should be used; and there
> are some special ones that are so far GCC implementation detail that you
> probably wouldn't even consider using them.

The asm register constraints are a public interface of "GNU C" for the
particular target architecture. Randomly removing them is a breaking change in
the language. There is no documented or even reliable way to detect which ones
work correctly for a particular compiler version, so change or removal of
semantics is particularly problematic.

> The maintenance cost for all the constraints we keep around because some
> important projects used them is considerable, fwiw.

One line in a table to preserve stability of the language is not what I call
"maintenance cost".


More information about the Gcc-bugs mailing list