i386: Disallow sibcall for calling ifunc functions with PIC register
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 14 Jun 2022 15:20:16 +0000 (08:20 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Mon, 20 Jun 2022 15:26:47 +0000 (08:26 -0700)
commitfe9765c0b97e6b4ce2cd226631d329fc05ba2aa5
tree0aa82431aa82b11596e02944610305db29075662
parent1b238124840a323e70771d88a5b8fae48f26c69b
i386: Disallow sibcall for calling ifunc functions with PIC register

Disallow siball when calling ifunc functions with PIC register so that
PIC register can be restored.

gcc/

PR target/105960
* config/i386/i386.cc (ix86_function_ok_for_sibcall): Return
false if PIC register is used when calling ifunc functions.

gcc/testsuite/

PR target/105960
* gcc.target/i386/pr105960.c: New test.
gcc/config/i386/i386.cc
gcc/testsuite/gcc.target/i386/pr105960.c [new file with mode: 0644]