Issue 139001
Summary x86: inline asm: make %a compatible with gcc
Labels new issue
Assignees
Reporter hpax
    On x86, the %a assembly modifier behaves differently between gcc and clang:

When used with an "i" input operand, on gcc it produces a %rip-relative address reference when compiling for 64 bits, whereas on clang, it does not.

The gcc people have stated that that is the preferred way to get a memory reference with (%rip) on x86-64 and a plain memory reference on i386, without having to put explicit hacks in the assembly code. This would be useful for cleaning up code in the Linux kernel.

The gcc documentation is, as usual, weak on the exact semantics of its inline assembly, but see the following gcc bugzilla:

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

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to