From patchwork Tue Jan 20 02:31:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tbsaunde+gcc@tbsaunde.org X-Patchwork-Id: 430763 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 142AF1402D8 for ; Tue, 20 Jan 2015 13:32:04 +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:from :to:cc:subject:date:message-id; q=dns; s=default; b=PP2aqqFsIlyW neCohPhr5PEr+Kn/CfFgfQlAZh1QeZNVjTRDX5zaYe/8YmKd+WqtNUBXf1FBziNa +374XqGixtYaTWNeIToD4ujvew6vmofqRwMfcAaiqvnoC1ZlPpBR8CpSxJSFWhI1 +e3Yq8gW0X1iHtGEKOR5V0+y0AulXWo= 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:from :to:cc:subject:date:message-id; s=default; bh=ewixfU1f6KaXphaDDf 2Rc0Tnk4o=; b=BNo3S+fB/Nc6Myc5je0lluzuYdnV2mb8zkj9znHRUrPN+JSmki lIdOYXEJtYHuHUt4DpoHupqtXg6SWl72m0f0rtwvouuZ0Lc0+AtzJDjNXI6RXiZU frs0YIqb06T7LrSmRsFdjjPbcFcXKlu2ROT2CvKgrUdD3Y4iPtOYbR0Pc= Received: (qmail 30406 invoked by alias); 20 Jan 2015 02:31: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 30391 invoked by uid 89); 20 Jan 2015 02:31:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: paperclip.tbsaunde.org Received: from tbsaunde.org (HELO paperclip.tbsaunde.org) (66.228.47.254) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Jan 2015 02:31:48 +0000 Received: from iceball.corp.tor1.mozilla.com (unknown [66.207.208.102]) by paperclip.tbsaunde.org (Postfix) with ESMTPSA id 93501C078; Tue, 20 Jan 2015 02:31:46 +0000 (UTC) From: tbsaunde+gcc@tbsaunde.org To: gcc-patches@gcc.gnu.org Cc: Trevor Saunders Subject: [PATCH] pr 64076 - tolerate different definitions of symbols in lto Date: Mon, 19 Jan 2015 21:31:12 -0500 Message-Id: <1421721072-6962-1-git-send-email-tbsaunde+gcc@tbsaunde.org> X-IsSubscribed: yes From: Trevor Saunders Hi, when doing an lto link we can have some symbols be ir only and others be machine code, which trips the assert here. Just adjust the assert to handle that. bootstrapped + regtested x86_64-linux-gnu, ok? Trev gcc/ * ipa-visibility.c (update_visibility_by_resolution_info): Only assert when not in lto mode. --- gcc/ipa-visibility.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/gcc/ipa-visibility.c b/gcc/ipa-visibility.c index 71894af..0791a1c 100644 --- a/gcc/ipa-visibility.c +++ b/gcc/ipa-visibility.c @@ -425,11 +425,19 @@ update_visibility_by_resolution_info (symtab_node * node) if (node->same_comdat_group) for (symtab_node *next = node->same_comdat_group; next != node; next = next->same_comdat_group) - gcc_assert (!next->externally_visible - || define == (next->resolution == LDPR_PREVAILING_DEF_IRONLY - || next->resolution == LDPR_PREVAILING_DEF - || next->resolution == LDPR_UNDEF - || next->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP)); + { + if (!next->externally_visible) + continue; + + bool same_def + = define == (next->resolution == LDPR_PREVAILING_DEF_IRONLY + || next->resolution == LDPR_PREVAILING_DEF + || next->resolution == LDPR_UNDEF + || next->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP); + gcc_assert (in_lto_p || same_def); + if (!same_def) + return; + } if (node->same_comdat_group) for (symtab_node *next = node->same_comdat_group;