From patchwork Mon Apr 16 20:07:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 898909 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-476446-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mentor.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="qTJ0pZ4s"; 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 40Pzvp69ZFz9s19 for ; Tue, 17 Apr 2018 06:08:05 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=AQH1Ny9+o4Z8YFLCVY61SEPxyMqA2GjEQkExIi2p2S/dSfsG/2 xzcwhy9hhMDzj/ZMS8vGPNcSQNnMJhBNeumsVXqRbo1MjOk9+vjqTH94k2Wy9uK2 59I9xt0hl+2npdmQpxe85cRp9w4C1DahcOYhVJQhpCAbESjyaT7deYo1w= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=iYcHu5LWB7yLyZLV75SQnfypzmg=; b=qTJ0pZ4s2dIcX59mPWUI 7vBxAVMn2MJEf+kAR1jejS0qRgVjMUBaxSCYX2oyTy0IUFhvt519HHV6zn8igkbu 2dp3ZrDAr5y88sx4y96ejzdCGviO0wePQ2M3BsZA4VNEndIO9jviZA+M3Ymz/wcQ tLrkHYttrsPwj6C7ZFrHvCg= Received: (qmail 5889 invoked by alias); 16 Apr 2018 20:07: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 5879 invoked by uid 89); 16 Apr 2018 20:07:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Apr 2018 20:07:54 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1f8APo-000630-Os from Tom_deVries@mentor.com for gcc-patches@gcc.gnu.org; Mon, 16 Apr 2018 13:07:52 -0700 Received: from [172.30.72.215] (137.202.0.87) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Mon, 16 Apr 2018 21:07:49 +0100 To: GCC Patches , Thomas Schwinge From: Tom de Vries Subject: [og7] Backport "[nvptx] Add exit after call to noreturn function" Message-ID: <289216ae-113e-282d-116b-e35443c511da@mentor.com> Date: Mon, 16 Apr 2018 22:07:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) Hi, while investigating PR85381 - "[og7, nvptx, openacc] parallel-loop-1.c fails with default vector length 128", I ran into PR 80035/81069. I've backported the fix to the og7 branch. Thanks, - Tom Backport "[nvptx] Add exit after call to noreturn function" 2018-04-16 Tom de Vries backport from trunk: 2017-09-25 Tom de Vries PR target/80035 PR target/81069 * config/nvptx/nvptx.c (nvptx_output_call_insn): Add exit after call to noreturn function. --- gcc/config/nvptx/nvptx.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index 9d011eb..8c478c8 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -2387,11 +2387,14 @@ nvptx_output_call_insn (rtx_insn *insn, rtx result, rtx callee) fprintf (asm_out_file, ";\n"); if (find_reg_note (insn, REG_NORETURN, NULL)) - /* No return functions confuse the PTX JIT, as it doesn't realize - the flow control barrier they imply. It can seg fault if it - encounters what looks like an unexitable loop. Emit a trailing - trap, which it does grok. */ - fprintf (asm_out_file, "\t\ttrap; // (noreturn)\n"); + { + /* No return functions confuse the PTX JIT, as it doesn't realize + the flow control barrier they imply. It can seg fault if it + encounters what looks like an unexitable loop. Emit a trailing + trap and exit, which it does grok. */ + fprintf (asm_out_file, "\t\ttrap; // (noreturn)\n"); + fprintf (asm_out_file, "\t\texit; // (noreturn)\n"); + } if (result) {