From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2195 invoked by alias); 31 Jan 2006 16:42:57 -0000 Received: (qmail 1863 invoked by uid 48); 31 Jan 2006 16:42:52 -0000 Date: Tue, 31 Jan 2006 16:42:00 -0000 Message-ID: <20060131164252.1862.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/25377] [4.2 Regression] weakref sibcalled with -fPIC In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-01/txt/msg03481.txt.bz2 List-Id: ------- 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