From patchwork Fri May 23 11:08:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 351803 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 BFC9C140086 for ; Fri, 23 May 2014 21:08:32 +1000 (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:mime-version:content-type; q=dns; s=default; b=QNQJpPJO1QcCHGHO9/WDGGzJT6PODvTEMpjkNnfLOcghLzQNPi gSacRikyPVJp5yUlJRedqbYibe8RMwTd5JrBXE9XtAG8rOInwdDLZ6Mxg30Qbwzt Ki9X47BXXimaYcoDScGFL/+6GoCnM9R1XuDW6AnQDt7G73zgs9uaidsU0= 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:mime-version:content-type; s= default; bh=grpamdu/piZVUECThgL8gwE4znQ=; b=lzcgRQqFjcPGSkNeZaQi W0DRJE6efKawej1vFPMsM8HQjp8wbb6Sd2qViHyQOxZhnJZeksQZRw1xvi/WzpOQ 7bNLprx8HBJGVDDhqixAjXuBQ+4j/2gpIqhz5OuUwlXFmWpDBLS3eJEdOHn0qweq KdhgUSV5O4sPk26gB6J0UNM= Received: (qmail 19497 invoked by alias); 23 May 2014 11:08:25 -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 19471 invoked by uid 89); 23 May 2014 11:08:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 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, 23 May 2014 11:08:23 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1WnnKk-0005lq-VQ from Thomas_Schwinge@mentor.com ; Fri, 23 May 2014 04:08:19 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 23 May 2014 04:08:18 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Fri, 23 May 2014 12:08:17 +0100 From: Thomas Schwinge To: CC: Subject: [COMMITTED] Be more explicit. Date: Fri, 23 May 2014 13:08:09 +0200 Message-ID: <1400843293-14348-1-git-send-email-thomas@codesourcery.com> MIME-Version: 1.0 From: tschwinge gcc/ * gimplify.c (omp_notice_variable) : Explicitly enumerate the expected region types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210852 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/gimplify.c | 15 +++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git gcc/ChangeLog gcc/ChangeLog index aedf2d0..d351c0b 100644 --- gcc/ChangeLog +++ gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-05-23 Thomas Schwinge + + * gimplify.c (omp_notice_variable) : + Explicitly enumerate the expected region types. + 2014-05-23 Paul Eggert PR other/56955 diff --git gcc/gimplify.c gcc/gimplify.c index 3241633..39b2750 100644 --- gcc/gimplify.c +++ gcc/gimplify.c @@ -5683,7 +5683,14 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code) switch (default_kind) { case OMP_CLAUSE_DEFAULT_NONE: - if ((ctx->region_type & ORT_TASK) != 0) + if (ctx->region_type == ORT_PARALLEL + || ctx->region_type == ORT_COMBINED_PARALLEL) + { + error ("%qE not specified in enclosing parallel", + DECL_NAME (lang_hooks.decls.omp_report_decl (decl))); + error_at (ctx->location, "enclosing parallel"); + } + else if ((ctx->region_type & ORT_TASK) != 0) { error ("%qE not specified in enclosing task", DECL_NAME (lang_hooks.decls.omp_report_decl (decl))); @@ -5696,11 +5703,7 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code) error_at (ctx->location, "enclosing teams construct"); } else - { - error ("%qE not specified in enclosing parallel", - DECL_NAME (lang_hooks.decls.omp_report_decl (decl))); - error_at (ctx->location, "enclosing parallel"); - } + gcc_unreachable (); /* FALLTHRU */ case OMP_CLAUSE_DEFAULT_SHARED: flags |= GOVD_SHARED;