From a5a5434f7b594a05a910fdee97ca569cc318a221 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 23 May 2014 13:07:57 +0200 Subject: [PATCH] Be more explicit. gcc/ * gimplify.c (omp_notice_variable) : Explicitly enumerate the expected region types. From-SVN: r210852 --- gcc/ChangeLog | 5 +++++ gcc/gimplify.c | 15 +++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aedf2d0a099f..d351c0b29262 100644 --- a/gcc/ChangeLog +++ b/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 a/gcc/gimplify.c b/gcc/gimplify.c index 32416331ac5c..39b27507174e 100644 --- a/gcc/gimplify.c +++ b/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; -- 2.47.3