This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/25377] [4.2 Regression] weakref sibcalled with -fPIC
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jan 2006 16:42:52 -0000
- Subject: [Bug target/25377] [4.2 Regression] weakref sibcalled with -fPIC
- References: <bug-25377-11659@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from pinskia at gcc dot gnu dot org 2006-01-31 16:42 -------
And yes that fixed my reduced testcase.
The patch is:
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 110396)
+++ config/i386/i386.c (working copy)
@@ -2211,7 +2211,7 @@ ix86_function_ok_for_sibcall (tree decl,
/* If we are generating position-independent code, we cannot sibcall
optimize any indirect call, or a direct call to a global function,
as the PLT requires %ebx be live. */
- if (!TARGET_64BIT && flag_pic && (!decl || TREE_PUBLIC (decl)))
+ if (!TARGET_64BIT && flag_pic && (!decl || !targetm.binds_local_p (decl)))
return false;
if (decl)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25377