]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Be more explicit.
authorThomas Schwinge <thomas@codesourcery.com>
Fri, 23 May 2014 11:07:57 +0000 (13:07 +0200)
committerThomas Schwinge <tschwinge@gcc.gnu.org>
Fri, 23 May 2014 11:07:57 +0000 (13:07 +0200)
gcc/
* gimplify.c (omp_notice_variable) <case OMP_CLAUSE_DEFAULT_NONE>:
Explicitly enumerate the expected region types.

From-SVN: r210852

gcc/ChangeLog
gcc/gimplify.c

index aedf2d0a099f1afc8b5d1ed75dc273ddccac8515..d351c0b29262e65573c954c1c932519315cff7a6 100644 (file)
@@ -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
index 32416331ac5c6e43c2f3f6fddb1ddfe87a767379..39b27507174e68511080ffc782647993e6f94e9a 100644 (file)
@@ -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;