From patchwork Tue Feb 4 06:07:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 316432 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 671BC2C0091 for ; Tue, 4 Feb 2014 17:08:02 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=kKWoIICLh6xrHfNiwnKkS0BH3ljlNy0nW+xsFuKskCqbC3zaZoeDG duoF2NqsDwlv3Fpo+PVA/qOmuuWxo6QogfF9gB1TGw7lbbGa3OZJUmbDmlZZi8aL ADq2OrM8fwWLOrCMefmH/GuM73AorppTPSXvE36MadC5h9X0NV6zJs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=jdXx/XzFt2V2mh7S5pHfbrSnxvE=; b=smo9OYO8VFdlVN++2pth KWQsJGIadYnk+4y2d1IqU3JH5MWrSelmrtdrbdhdjKwu9+n2ybMd0E+M1ON1uLyq qjUXFOfjFHctbXo07X69L21Hzme1lKWehugUEgbfmKSgsCsSbgwep9c9ie8ar9KO nsmc22FzPF1syUvujIksGAY= Received: (qmail 26407 invoked by alias); 4 Feb 2014 06:07:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 26373 invoked by uid 89); 4 Feb 2014 06:07:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 04 Feb 2014 06:07:22 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 707D4542CEF; Tue, 4 Feb 2014 07:07:19 +0100 (CET) Date: Tue, 4 Feb 2014 07:07:19 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, rguenther@suse.de Subject: Allow references to symbols with user specified DEFAULT bisibility Message-ID: <20140204060719.GB26386@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Hi, while implementing checks in can_refer_decl_in_current_unit_p I had primarily symbols with HIDDEN visibility in mind. I just noticed that libstdc++ makes quite few symbols with default visbility specified by hand. I see no reason for disabling optimization here. Bootstrapped/regtested x86_64-linux, OK? * gimple-fold.c (can_refer_decl_in_current_unit_p): Allow references to symbols with user specified default visibility. Index: gimple-fold.c =================================================================== --- gimple-fold.c (revision 207450) +++ gimple-fold.c (working copy) @@ -114,6 +114,7 @@ can_refer_decl_in_current_unit_p (tree d unit may be in separate DSO and the symbol may be hidden. */ if (DECL_VISIBILITY_SPECIFIED (decl) && DECL_EXTERNAL (decl) + && DECL_VISIBILITY (decl) != VISIBILITY_DEFAULT && (!(snode = symtab_get_node (decl)) || !snode->in_other_partition)) return false; /* When function is public, we always can introduce new reference.