From patchwork Fri Feb 21 20:32:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 323014 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 AB0D52C032D for ; Sat, 22 Feb 2014 07:32:41 +1100 (EST) 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:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=u1kV00IUQYwsZ1og PPp0+1JF09v5M+Q7B//K1mD6RiteoDvWN3ixJG9D05euugMosFVk2ts8KInqaFEI i7L+ITK6bPH2k68OlJUT3UTrvVzAsjfMOLgV2KwSeeyAvO1ZB9CBNsaj8rpgzo9n FZXbdIP3/buKA5HrpNFahe1YazE= 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:in-reply-to:references :mime-version:content-type; s=default; bh=Xk8Oqr7HYOZhFCzFAskXkQ pxYkE=; b=k/vxIZlfSLGvXUi5VZJn42Z3Up5rDAkkU1DdWBraRGYAMEtANyJ1X7 YlkJSTwk0stzhyw7mJks34WCH1S+9hbe3kylTeZPFvTOO8ngT+LcpNQ0HZefWUjc sxBF2CROPFbDT1Iia7q4nf1T2Eftk5mMC6vdnqV6Rp5JUUxjmmlHU= Received: (qmail 18890 invoked by alias); 21 Feb 2014 20:32:32 -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 18878 invoked by uid 89); 21 Feb 2014 20:32:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 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; Fri, 21 Feb 2014 20:32:30 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WGwll-0000nv-Rm from Thomas_Schwinge@mentor.com ; Fri, 21 Feb 2014 12:32:25 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 21 Feb 2014 12:32:25 -0800 Received: from build5-lucid-cs (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Fri, 21 Feb 2014 12:31:38 -0800 Received: by build5-lucid-cs (Postfix, from userid 49978) id 09BF43219B8; Fri, 21 Feb 2014 12:32:24 -0800 (PST) From: Thomas Schwinge To: CC: Subject: [gomp4 1/3] Clarify to/from/map clauses usage in context of GF_OMP_TARGET_KIND_UPDATE. Date: Fri, 21 Feb 2014 21:32:13 +0100 Message-ID: <1393014736-19719-1-git-send-email-thomas@codesourcery.com> In-Reply-To: <877g8os0vx.fsf@kepler.schwinge.homeip.net> References: <877g8os0vx.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 From: tschwinge gcc/ * omp-low.c (scan_sharing_clauses): Catch unexpected occurrences of OMP_CLAUSE_TO, OMP_CLAUSE_FROM, OMP_CLAUSE_MAP. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@208015 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog.gomp | 3 +++ gcc/omp-low.c | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp index bf8ec96..bd46f2e 100644 --- gcc/ChangeLog.gomp +++ gcc/ChangeLog.gomp @@ -1,5 +1,8 @@ 2014-02-21 Thomas Schwinge + * omp-low.c (scan_sharing_clauses): Catch unexpected occurrences + of OMP_CLAUSE_TO, OMP_CLAUSE_FROM, OMP_CLAUSE_MAP. + * gimplify.c (enum omp_region_type): Make ORT_TARGET_OFFLOAD a flag for ORT_TARGET, in its negation replacing ORT_TARGET_DATA. Update all users. diff --git gcc/omp-low.c gcc/omp-low.c index 9fef4c1..bca4599 100644 --- gcc/omp-low.c +++ gcc/omp-low.c @@ -1630,6 +1630,26 @@ scan_sharing_clauses (tree clauses, omp_context *ctx) case OMP_CLAUSE_FROM: gcc_assert (!is_gimple_omp_oacc_specifically (ctx->stmt)); case OMP_CLAUSE_MAP: + switch (OMP_CLAUSE_CODE (c)) + { + case OMP_CLAUSE_TO: + case OMP_CLAUSE_FROM: + /* The to and from clauses are only ever seen with OpenMP target + update constructs. */ + gcc_assert (gimple_code (ctx->stmt) == GIMPLE_OMP_TARGET + && (gimple_omp_target_kind (ctx->stmt) + == GF_OMP_TARGET_KIND_UPDATE)); + break; + case OMP_CLAUSE_MAP: + /* The map clause is never seen with OpenMP target update + constructs. */ + gcc_assert (gimple_code (ctx->stmt) != GIMPLE_OMP_TARGET + || (gimple_omp_target_kind (ctx->stmt) + != GF_OMP_TARGET_KIND_UPDATE)); + break; + default: + gcc_unreachable (); + } if (ctx->outer) scan_omp_op (&OMP_CLAUSE_SIZE (c), ctx->outer); decl = OMP_CLAUSE_DECL (c); @@ -1799,6 +1819,11 @@ scan_sharing_clauses (tree clauses, omp_context *ctx) break; case OMP_CLAUSE_MAP: + /* The map clause is never seen with OpenMP target update + constructs. */ + gcc_assert (gimple_code (ctx->stmt) != GIMPLE_OMP_TARGET + || (gimple_omp_target_kind (ctx->stmt) + != GF_OMP_TARGET_KIND_UPDATE)); if (!gimple_code_is_oacc (ctx->stmt) && gimple_omp_target_kind (ctx->stmt) == GF_OMP_TARGET_KIND_DATA) break;