From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66842 invoked by alias); 26 Feb 2016 10:50:32 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 66824 invoked by uid 89); 26 Feb 2016 10:50:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy= 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; Fri, 26 Feb 2016 10:50:29 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id D69585434AD; Fri, 26 Feb 2016 11:50:25 +0100 (CET) Date: Fri, 26 Feb 2016 10:50:00 -0000 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, rguenther@suse.de Subject: Clear visibility of TYPE_DECL Message-ID: <20160226105025.GB94603@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2016-02/txt/msg01773.txt.bz2 Hi, while looking into PR69589 I noticed that types are not merged when pragma visibility does not match. This is because C++ FE stores visibility into TYPE_DECL that is used by FE only. This patch clears the flag in free_lang_data. Bootstrapped/regtested x86_64-linux and tested it makes no difference for Firefox LTO binary, OK? PR lto/69589 * tree.c (free_lang_data_in_decl): Clear visibility of TYPE_DECL. Index: tree.c =================================================================== --- tree.c (revision 233707) +++ tree.c (working copy) @@ -5472,8 +5473,13 @@ free_lang_data_in_decl (tree decl) || (decl_function_context (decl) && !TREE_STATIC (decl))) DECL_INITIAL (decl) = NULL_TREE; } - else if (TREE_CODE (decl) == TYPE_DECL - || TREE_CODE (decl) == FIELD_DECL) + else if (TREE_CODE (decl) == TYPE_DECL) + { + DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; + DECL_VISIBILITY_SPECIFIED (decl) = 0; + DECL_INITIAL (decl) = NULL_TREE; + } + else if (TREE_CODE (decl) == FIELD_DECL) DECL_INITIAL (decl) = NULL_TREE; else if (TREE_CODE (decl) == TRANSLATION_UNIT_DECL && DECL_INITIAL (decl)