From patchwork Mon May 16 14:25:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 622604 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 3r7jRd5FzVz9sCk for ; Tue, 17 May 2016 00:25:32 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=uobc04k1; 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:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=xEgwU2OMfLdgJy1TI/pTiZ3mecEyqPpclnsP22ISTSQn79pC+Z Jtuu0ejjbWc5qFRh/5dVyzH09uRuhFHRIWGg+SBYs3/HuM5m6SZ1oeeYAx4RiUXN urzd9e4KIu3I0gEWGWXVYWqiIyC2UUCbxBuFJQk1Tm1652MHwLwDV6jm4= 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:cc:subject:message-id:mime-version:content-type; s= default; bh=ht6mQmZ8qWFUOBKe750cjOnVjQE=; b=uobc04k1gGYtUv+lDEvW 88brxiTz/URmXrWeoQv8oieetjUEpAacZj6pt83RYK0OonjNd1YWhrA1Nk2zOtNw O46Kl25wh8tjxFRlPE5UCTlVeOyYFWxGh4wQwCFwuLSW/frY49/HwwEvY0Xaw4fG JYPJxa9fZMt7zxnNeHIZPmk= Received: (qmail 82406 invoked by alias); 16 May 2016 14:25:24 -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 82395 invoked by uid 89); 16 May 2016 14:25:24 -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= 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 (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 16 May 2016 14:25:13 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8341DAE07; Mon, 16 May 2016 14:25:10 +0000 (UTC) Date: Mon, 16 May 2016 16:25:10 +0200 From: Martin Jambor To: GCC Patches Cc: Jakub Jelinek Subject: [PR 70857] Copy RESULT_DECL of HSA outlined kernel function Message-ID: <20160516142510.GM5580@virgil.suse.cz> Mail-Followup-To: GCC Patches , Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.0 (2016-04-01) X-IsSubscribed: yes Hi, the patch below fixes PR 70857. When the HSA gridification code copies the declaration of the function for outlining the target construct, it left the old RESULT_DECL dangling to it. I did not notice because it has VOID_TYPE but it needs to be done nevertheless, not least because ipa-pta chokes on it. Bootstrapped and tested on x86_64 with hsa enabled. OK for trunk and the gcc-6 branch? Thanks, Martin 2016-05-12 Martin Jambor PR hsa/70857 * omp-low.c (grid_expand_target_grid_body): Copy RESULT_DECL of the outlined kernel function. --- gcc/omp-low.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/omp-low.c b/gcc/omp-low.c index c9600fb..a11f44b 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -13681,6 +13681,9 @@ grid_expand_target_grid_body (struct omp_region *target) tree new_parm_decl = copy_node (DECL_ARGUMENTS (kern_fndecl)); DECL_CONTEXT (new_parm_decl) = kern_fndecl; DECL_ARGUMENTS (kern_fndecl) = new_parm_decl; + gcc_assert (VOID_TYPE_P (TREE_TYPE (DECL_RESULT (kern_fndecl)))); + DECL_RESULT (kern_fndecl) = copy_node (DECL_RESULT (kern_fndecl)); + DECL_CONTEXT (DECL_RESULT (kern_fndecl)) = kern_fndecl; struct function *kern_cfun = DECL_STRUCT_FUNCTION (kern_fndecl); kern_cfun->curr_properties = cfun->curr_properties;