https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99530
--- Comment #9 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Thiago Macieira from comment #8)
> (In reply to H.J. Lu from comment #7)
> > Created attachment 50369 [details]
> > The v2 patch
>
> Code generation with "call %P0" is now identical to what GCC generates on
> its own.
>
> Even the alignment is now right, somehow, though it also added a newline?
>
> $ ~/dev/gcc/bin/gcc -fPIC -fno-plt -S -o - -O2 -xc - <<<'extern void
> f(void); void g() { asm("cmp %P0,$0" : : "X" (f)); }' | grep -A1 GOTPC
>
> cmp *f@GOTPCREL(%rip)
> ,$0
>
> That's probably not right.
Don't use %P with cmp.