From patchwork Wed Jun 12 15:09:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 1114609 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-502841-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Kil68qjt"; 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 45P9KM0GTDz9s6w for ; Thu, 13 Jun 2019 01:10:11 +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:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=Zd0iv8meg+IWvQ9jSuSyzCqlU/rD51M5RjPZdZUWnxsovE6r7HK9R B6kHQ91DPZwdGNO5fT2TUNHQL7d4Ji9KhRk9N1Z50MmiPOMUlh1t4xIWzmDmNcP8 COAGf6+xNnPOszRIYbpfU7kPmyIo8Shov9FVAyTT49XEmjy0dMtg40= 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=HdOhuEDNk25Y0WcxRfSYVLWkyt0=; b=Kil68qjtR/aQg32o84nA 9PtfZfyciRAwZryFaLV4srTjTs93/4NEngvfA9o8wdlmDiT69lctJ+tA2OirRco/ 6/vaqm+xQuJIfZbUM3I3gRDLsqNLD/8jWyv8eCGZgSy76aMxe0GGiO0WS8sXjGsi gsNABO/pGxw+rPZjfsYq/UY= Received: (qmail 61201 invoked by alias); 12 Jun 2019 15:10:03 -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 61193 invoked by uid 89); 12 Jun 2019 15:10:03 -0000 Authentication-Results: sourceware.org; auth=none 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, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Jun 2019 15:10:02 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2FB06AE27 for ; Wed, 12 Jun 2019 15:10:00 +0000 (UTC) Date: Wed, 12 Jun 2019 17:09:58 +0200 From: Tom de Vries To: gcc-patches@gcc.gnu.org Subject: [committed][nvptx] Assert fork has at most one join in nvptx_find_par Message-ID: <20190612150956.GA13805@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi, With the test-case of PR90009 we run into a SIGSEGV in nvptx_neuter_pars, because par->join_insn and par->join_block are NULL. Detect this problem earlier, by adding an assert in nvptx_find_par that asserts that a fork cannot be paired with more than one join. Build and tested on x86_64 with nvptx accelerator enabled. Committed to trunk. Thanks, - Tom [nvptx] Assert fork has at most one join in nvptx_find_par 2019-06-12 Tom de Vries PR tree-optimization/90009 * config/nvptx/nvptx.c (nvptx_find_par): Assert fork has at most join. --- gcc/config/nvptx/nvptx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index a28099ac89d..1e34be18f75 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -3258,6 +3258,7 @@ nvptx_find_par (bb_insn_map_t *map, parallel *par, basic_block block) unsigned mask = UINTVAL (XVECEXP (PATTERN (end), 0, 0)); gcc_assert (par->mask == mask); + gcc_assert (par->join_block == NULL); par->join_block = block; par->join_insn = end; if (nvptx_needs_shared_bcast (mask))