This is the mail archive of the
mailing list for the glibc project.
Re: [patch] Change inline asm to work with llvm-gcc
On Tue, Dec 23, 2008 at 09:38:22AM -0800, Chris Lattner wrote:
>> What you find reasoanble on it? The numbered constraint just says
>> the same register is used for both the output and input, nothing else.
> LLVM requires the same size, not the same type. It prevents tying
> together a small output to a large input because the semantics are
> 'vague'. This is a new requirement and we can obviously change this
> back to work around glibc's headers.
For i386 (32-bit) int and int * are the same size (integer 32-bit register),
so why does llvm complain then?
BTW, gcc apparently doesn't reject even different size:
int foo (int *p)
asm ("# %0 %1 " : "=r" (q) : "0" (p));
for -m32 this shows # %eax %eax and for -m64 # %eax %rax
(in this case the behavior is obvious, of course you can write code where
you shoot yourself into the foot, but inline asm is a very low level
extension where the programmer must know what he is doing.