This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/51469] New: attr-ifunc-* tests fail on PowerPC if --enable-gnu-indirect-function is used
- From: "meissner at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 08 Dec 2011 18:56:46 +0000
- Subject: [Bug rtl-optimization/51469] New: attr-ifunc-* tests fail on PowerPC if --enable-gnu-indirect-function is used
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51469
Bug #: 51469
Summary: attr-ifunc-* tests fail on PowerPC if
--enable-gnu-indirect-function is used
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
AssignedTo: meissner@gcc.gnu.org
ReportedBy: meissner@gcc.gnu.org
Host: powerpc64-linux power-linux
Target: powerpc64-linux
Build: powerpc64-linux
The tests:
gcc.dg/attr-ifunc-1.c
gcc.dg/attr-ifunc-3.c
gcc.dg/attr-ifunc-4.c
gcc.dg/attr-ifunc-5.c
g++.dg/ext/attr-ifunc-1.C
g++.dg/ext/attr-ifunc-2.C
g++.dg/ext/attr-ifunc-3.C
all fail on PowerPC linux when the compiler is configured with
--enable-gnu-indirect-function
I traced this down, and the problem with the tests is that the gnu indirect
function (with the ifunc attribute) is in the same module as the call. The
SYMBOL_REF_LOCAL bit is set for these functions. Because SYMBOL_REF_LOCAL is
set, the PPC compiler assumes the call is in the same module and bypasses
putting a NOP after the BL instruction, which is used to restore the TOC.
Because the BL is not followed by a NOP, the assembler and linker will not
create a PLT for the function and use the indirect function to return the
address of the function to use for the call.