x86: Update 'P' operand modifier for -fno-plt
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 11 Mar 2021 14:48:24 +0000 (06:48 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 17 Mar 2021 14:06:10 +0000 (07:06 -0700)
commitadf14bdbc10d4114865a08cf20020a2616039057
tree6d0ba9dcaffd6600c4e1068ebd04eca5562d4015
parent39916ceab4940315e84bcd966da2c1d4a8e1734b
x86: Update 'P' operand modifier for -fno-plt

Update 'P' operand modifier for -fno-plt to support inline assembly
statements.  In 64-bit, we can always load function address with
@GOTPCREL.  In 32-bit, we load function address with @GOT only for
non-PIC since PIC register may not be available at call site.

gcc/

PR target/99504
* config/i386/i386.c (ix86_force_load_from_GOT_p): Support
inline assembly statements.
(ix86_print_operand): Update 'P' handling for -fno-plt.

gcc/testsuite/

PR target/99504
* gcc.target/i386/pr99530-1.c: New test.
* gcc.target/i386/pr99530-2.c: Likewise.
* gcc.target/i386/pr99530-3.c: Likewise.
* gcc.target/i386/pr99530-4.c: Likewise.
* gcc.target/i386/pr99530-5.c: Likewise.
* gcc.target/i386/pr99530-6.c: Likewise.
gcc/config/i386/i386.c
gcc/testsuite/gcc.target/i386/pr99530-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr99530-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr99530-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr99530-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr99530-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr99530-6.c [new file with mode: 0644]