-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
Description
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: