From patchwork Tue Dec 17 15:58:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1211481 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-516124-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Ma4ce4fG"; dkim-atps=neutral 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 47cjVz0yzkz9sPW for ; Wed, 18 Dec 2019 02:59:05 +1100 (AEDT) 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=KybpDbK+6ZVe7hWsVCIMkk0IYaStaCrJZtRDSlBKTTATNcu4ftH/t tZcxBuwkJSCaCz/KXN27gkTYH1b2c05pgUSyh66MOoJRnm7c5qlzX2Ps4P0MCq5B Fds7MUdJRZ4qsLMplWOx7HI7QiSd7/so3HsbYGt66XTB8ZQj/F5FeU= 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=ch65hTDIubqtcoR8IZlNnA6WnXw=; b=Ma4ce4fGtZ544ssUniRb Ha3MicgL0YFx/Fy1Teo1YcoKtvK4qEnAnyxT/184jN2DU9eK1SaDOo5vuqiZ4Snf oqGrsw58FEKxmI7wUMwxExUFj2Idr7diRY0hDmmz3iwJxIfnwiTbJ4UDmXYb/quM 3ONJUY8wsYQgvWna3gM4HZw= Received: (qmail 117215 invoked by alias); 17 Dec 2019 15:58:58 -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 117207 invoked by uid 89); 17 Dec 2019 15:58:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN autolearn=ham version=3.3.1 spammy=partition, sk:get_par 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 ESMTP; Tue, 17 Dec 2019 15:58:56 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 106BA28239A; Tue, 17 Dec 2019 16:58:54 +0100 (CET) Date: Tue, 17 Dec 2019 16:58:54 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix partitioning ICE with external comdats Message-ID: <20191217155854.pjzovhvqqfuiz7o5@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Hi, while hacking firefox to work around ABI compatibility issues with LLVM I ran into an ICE where comdat group was resolved externaly but contains a static alias (for thunk). In this case parittioner attempts to put that static definition into a partition which triggers an ICE. Bootstrapped/regtested x86_64-linux, comitted. * symtab.c (symtab_node::get_partitioning_class): Aliases of external symbols are external. Index: symtab.c =================================================================== --- symtab.c (revision 279178) +++ symtab.c (working copy) @@ -1952,6 +1952,11 @@ symtab_node::get_partitioning_class (voi if (DECL_EXTERNAL (decl)) return SYMBOL_EXTERNAL; + /* Even static aliases of external functions as external. Those can happen + when COMDAT got resolved to non-IL implementation. */ + if (alias && DECL_EXTERNAL (ultimate_alias_target ()->decl)) + return SYMBOL_EXTERNAL; + if (varpool_node *vnode = dyn_cast (this)) { if (alias && definition && !ultimate_alias_target ()->definition)