https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83782
--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by H.J. Lu <h...@gcc.gnu.org>: https://gcc.gnu.org/g:80928920147a109a7f8735bffc55a72cbe8db185 commit r13-1919-g80928920147a109a7f8735bffc55a72cbe8db185 Author: H.J. Lu <hjl.to...@gmail.com> Date: Wed Jul 20 16:57:32 2022 -0700 x86: Add ix86_ifunc_ref_local_ok We can't always use the PLT entry as the function address for local IFUNC functions. When the PIC register is needed for PLT call, indirect call via the PLT entry will fail since the PIC register may not be set up properly for indirect call. Add ix86_ifunc_ref_local_ok to return false when the PLT entry can't be used as local IFUNC function pointers. gcc/ PR target/83782 * config/i386/i386.cc (ix86_ifunc_ref_local_ok): New. (TARGET_IFUNC_REF_LOCAL_OK): Use it. gcc/testsuite/ PR target/83782 * gcc.target/i386/pr83782-1.c: Require non-ia32. * gcc.target/i386/pr83782-2.c: Likewise. * gcc.target/i386/pr83782-3.c: New test.