diff mbox

[COMMITTED] Be more explicit.

Message ID 1400843293-14348-1-git-send-email-thomas@codesourcery.com
State New
Headers show

Commit Message

Thomas Schwinge May 23, 2014, 11:08 a.m. UTC
From: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>

	gcc/
	* gimplify.c (omp_notice_variable) <case OMP_CLAUSE_DEFAULT_NONE>:
	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(-)

Comments

Jakub Jelinek May 23, 2014, 11:34 a.m. UTC | #1
On Fri, May 23, 2014 at 01:08:09PM +0200, Thomas Schwinge wrote:
> @@ -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)

This should have been (ctx->region_type & ORT_PARALLEL) != 0 instead.

	Jakub
diff mbox

Patch

diff --git gcc/ChangeLog gcc/ChangeLog
index aedf2d0..d351c0b 100644
--- gcc/ChangeLog
+++ gcc/ChangeLog
@@ -1,3 +1,8 @@ 
+2014-05-23  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* gimplify.c (omp_notice_variable) <case OMP_CLAUSE_DEFAULT_NONE>:
+	Explicitly enumerate the expected region types.
+
 2014-05-23  Paul Eggert  <eggert@cs.ucla.edu>
 
 	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;