Commit a5a5434f by Thomas Schwinge Committed by Thomas Schwinge

Be more explicit.

	gcc/
	* gimplify.c (omp_notice_variable) <case OMP_CLAUSE_DEFAULT_NONE>:
	Explicitly enumerate the expected region types.

From-SVN: r210852
parent edbba2ce
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> 2014-05-23 Paul Eggert <eggert@cs.ucla.edu>
PR other/56955 PR other/56955
......
...@@ -5683,7 +5683,14 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code) ...@@ -5683,7 +5683,14 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code)
switch (default_kind) switch (default_kind)
{ {
case OMP_CLAUSE_DEFAULT_NONE: 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", error ("%qE not specified in enclosing task",
DECL_NAME (lang_hooks.decls.omp_report_decl (decl))); 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) ...@@ -5696,11 +5703,7 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code)
error_at (ctx->location, "enclosing teams construct"); error_at (ctx->location, "enclosing teams construct");
} }
else else
{ gcc_unreachable ();
error ("%qE not specified in enclosing parallel",
DECL_NAME (lang_hooks.decls.omp_report_decl (decl)));
error_at (ctx->location, "enclosing parallel");
}
/* FALLTHRU */ /* FALLTHRU */
case OMP_CLAUSE_DEFAULT_SHARED: case OMP_CLAUSE_DEFAULT_SHARED:
flags |= GOVD_SHARED; flags |= GOVD_SHARED;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment