From patchwork Mon Aug 15 16:51:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 659353 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 3sChNv28Mfz9t3V for ; Tue, 16 Aug 2016 02:52:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=MvPmxSPU; dkim-atps=neutral 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=qyZCNeZXJ02IvO1rHFFIuYUBr6FpZxJylICbGx51w40ZZE/rzvVuk zBHo6uphcXipJXt4jnoa5G7y71DK8G1MYcMBxrU8H5QTaFq9EPvcidePPoeyzXC+ cL6ofCaxS4bSpkUcbpbOfdjMx9mHnKnPubLTjPtzRvX5A8yJVVgPUY= 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=vD1k0EV6HuHBj0xssVWIzCrXerY=; b=MvPmxSPUlVOLd+Iap5aD gKRVJ2UcatL9hXGpzesUzQ1tqikbW6rPmCy6tmNXMrQxQ9IcKglzqeP8xHx434pC yvICyiL0Za/T8sc7LuSUhf/PY7hmViR6nwEDPIxeWtIodgsjUo4f2QxaWR9tE49n e8k5brEBHrAwYUqGpAgBnOg= Received: (qmail 120212 invoked by alias); 15 Aug 2016 16:52:08 -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 120197 invoked by uid 89); 15 Aug 2016 16:52:07 -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, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1422, ours X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 15 Aug 2016 16:51:57 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6DDCBAD33 for ; Mon, 15 Aug 2016 16:51:55 +0000 (UTC) Date: Mon, 15 Aug 2016 18:51:55 +0200 From: Martin Jambor To: GCC Patches Subject: [hsa-branch] Fix ICE in binds_to_current_def_p Message-ID: <20160815165154.jraccgnqzsp3x53a@virgil.suse.cz> Mail-Followup-To: GCC Patches MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.2-neo (2016-06-11) X-IsSubscribed: yes Hi, we have found out that when building a shared object file with pure/const HSA functions in them, we hit an assert in binds_to_current_def_p. The reason is that we are creating a clone for the HSA implementation and even though normally clones are private, ours isn't and so we need to set back not only the TREE_PUBLIC flag but also the cgraph externally_visible flag. I will commit it to the branch and queue for trunk for later. Thanks, Martin 2016-08-12 Martin Jambor * ipa-hsa.c (process_hsa_functions): Copy externally visible flag to the node. --- gcc/ipa-hsa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/ipa-hsa.c b/gcc/ipa-hsa.c index 9ab4927..0fbe2e2 100644 --- a/gcc/ipa-hsa.c +++ b/gcc/ipa-hsa.c @@ -90,6 +90,7 @@ process_hsa_functions (void) = node->create_virtual_clone (vec (), NULL, NULL, "hsa"); TREE_PUBLIC (clone->decl) = TREE_PUBLIC (node->decl); + clone->externally_visible = node->externally_visible; clone->force_output = true; hsa_summaries->link_functions (clone, node, s->m_kind, false); @@ -107,6 +108,7 @@ process_hsa_functions (void) = node->create_virtual_clone (vec (), NULL, NULL, "hsa"); TREE_PUBLIC (clone->decl) = TREE_PUBLIC (node->decl); + clone->externally_visible = node->externally_visible; if (!cgraph_local_p (node)) clone->force_output = true;