[llvm] [X86] Asm modifier %a: add (%rip) for 64-bit static relocation model (PR #139040)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Thu May 8 20:53:01 PDT 2025
MaskRay wrote:
> > In GCC,
> > ```
> > static int a;
> > asm("# %0" : : "i"(&a));
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > lowers to `# a(%rip)` regardless of the PIC mode. This PR follow suits for ELF -fno-pic, matching ELF -fpic (asm-modifier-pic.ll) and Mach-O (which defaults to PIC).
> > Close #139001
>
> Maybe we can use a better example in the description? This example does not use "a" modifier.
Updated!
https://github.com/llvm/llvm-project/pull/139040
More information about the llvm-commits
mailing list