From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116646 invoked by alias); 28 Feb 2015 22:40:03 -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 116637 invoked by uid 89); 28 Feb 2015 22:40:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,T_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; Sat, 28 Feb 2015 22:40:02 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id B1FC65450B2; Sat, 28 Feb 2015 23:39:58 +0100 (CET) Date: Sat, 28 Feb 2015 22:42:00 -0000 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, mliska@suse.cz Subject: Prevent merging across COMDAT group boundary Message-ID: <20150228223958.GC1771@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: 2015-02/txt/msg01758.txt.bz2 Hi, tihs patch fixes one case I forgot in sem_function::merge: When target is not in comdat group, we still can not make alias in the case source is. Bootstrapped/regtested x86_64-linux, Martin, can you double check this fixes the xalancbmk? Honza PR ipa/65237 * ipa-icf.c (sem_function::merge): Do not attempt to produce alias across COMDAT group boundary. Index: ipa-icf.c =================================================================== --- ipa-icf.c (revision 221076) +++ ipa-icf.c (working copy) @@ -745,12 +755,17 @@ sem_function::merge (sem_item *alias_ite it is an external functions where we can not create an alias (ORIGINAL_DISCARDABLE) 3) if target do not support symbol aliases. + 4) original and alias lie in different comdat groups. If we can not produce alias, we will turn ALIAS into WRAPPER of ORIGINAL and/or redirect all callers from ALIAS to ORIGINAL. */ if ((original_address_matters && alias_address_matters) - || original_discardable - || !sem_item::target_supports_symbol_aliases_p ()) + || (original_discardable + && (!DECL_COMDAT_GROUP (alias->decl) + || (DECL_COMDAT_GROUP (alias->decl) + != DECL_COMDAT_GROUP (original->decl)))) + || !sem_item::target_supports_symbol_aliases_p () + || DECL_COMDAT_GROUP (alias->decl) != DECL_COMDAT_GROUP (original->decl)) { /* First see if we can produce wrapper. */