https://gcc.gnu.org/g:891f3250cd93ae8670879fa97b8da59a9966e13f

commit 891f3250cd93ae8670879fa97b8da59a9966e13f
Author: Sandra Loosemore <[email protected]>
Date:   Fri Jul 3 15:33:50 2026 +0000

    OpenMP, Fortran: Fix indentation in resolve_omp_clauses_aff_dep_map_cache
    
    Commit basepoints/gcc-17-1747-ga7724fcb5f4 moved a large block of code
    from resolve_omp_clauses to a new function.  I noticed that the
    indentation of some nested switch statements looked odd when trying to
    rebase some patches on top of this, and Tobias independently had
    addressed this as part of his own WIP followup patch posted at
    https://gcc.gnu.org/pipermail/gcc-patches/2026-June/721741.html.  This
    patch addresses just the indentation problem and doesn't include any
    functional changes.
    
    gcc/fortran/ChangeLog
            * openmp.cc (resolve_omp_clauses_aff_dep_map_cache): Fix
            indentation.
    Co-authored-by: Tobias Burnus <[email protected]>
    
    (cherry picked from commit 150eb4c6e2b9ccce262a8bd06b575f3be017f99c)

Diff:
---
 gcc/fortran/openmp.cc | 160 +++++++++++++++++++++++++-------------------------
 1 file changed, 80 insertions(+), 80 deletions(-)

diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc
index 11ee8daedffc..1b54a00345f0 100644
--- a/gcc/fortran/openmp.cc
+++ b/gcc/fortran/openmp.cc
@@ -9889,92 +9889,92 @@ resolve_omp_clauses_aff_dep_map_cache (gfc_code *code,
       case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD:
       case EXEC_OMP_TARGET_TEAMS_LOOP:
       case EXEC_OMP_TARGET_DATA:
-           switch (n->u.map.op)
-             {
-             case OMP_MAP_TO:
-             case OMP_MAP_ALWAYS_TO:
-             case OMP_MAP_PRESENT_TO:
-             case OMP_MAP_ALWAYS_PRESENT_TO:
-             case OMP_MAP_FROM:
-             case OMP_MAP_ALWAYS_FROM:
-             case OMP_MAP_PRESENT_FROM:
-             case OMP_MAP_ALWAYS_PRESENT_FROM:
-             case OMP_MAP_TOFROM:
-             case OMP_MAP_ALWAYS_TOFROM:
-             case OMP_MAP_PRESENT_TOFROM:
-             case OMP_MAP_ALWAYS_PRESENT_TOFROM:
-             case OMP_MAP_ALLOC:
-             case OMP_MAP_PRESENT_ALLOC:
-                         break;
-             default:
-                         gfc_error ("TARGET%s with map-type other than TO, "
-                                    "FROM, TOFROM, or ALLOC on MAP clause "
-                                    "at %L",
-                                    code->op == EXEC_OMP_TARGET_DATA
-                                    ? " DATA" : "", &n->where);
-                         break;
-             }
+       switch (n->u.map.op)
+         {
+         case OMP_MAP_TO:
+         case OMP_MAP_ALWAYS_TO:
+         case OMP_MAP_PRESENT_TO:
+         case OMP_MAP_ALWAYS_PRESENT_TO:
+         case OMP_MAP_FROM:
+         case OMP_MAP_ALWAYS_FROM:
+         case OMP_MAP_PRESENT_FROM:
+         case OMP_MAP_ALWAYS_PRESENT_FROM:
+         case OMP_MAP_TOFROM:
+         case OMP_MAP_ALWAYS_TOFROM:
+         case OMP_MAP_PRESENT_TOFROM:
+         case OMP_MAP_ALWAYS_PRESENT_TOFROM:
+         case OMP_MAP_ALLOC:
+         case OMP_MAP_PRESENT_ALLOC:
            break;
+         default:
+           gfc_error ("TARGET%s with map-type other than TO, "
+                      "FROM, TOFROM, or ALLOC on MAP clause "
+                      "at %L",
+                      code->op == EXEC_OMP_TARGET_DATA
+                      ? " DATA" : "", &n->where);
+           break;
+         }
+       break;
       case EXEC_OMP_TARGET_ENTER_DATA:
-           switch (n->u.map.op)
-             {
-             case OMP_MAP_TO:
-             case OMP_MAP_ALWAYS_TO:
-             case OMP_MAP_PRESENT_TO:
-             case OMP_MAP_ALWAYS_PRESENT_TO:
-             case OMP_MAP_ALLOC:
-             case OMP_MAP_PRESENT_ALLOC:
-                         break;
-             case OMP_MAP_TOFROM:
-                         n->u.map.op = OMP_MAP_TO;
-                         break;
-             case OMP_MAP_ALWAYS_TOFROM:
-                         n->u.map.op = OMP_MAP_ALWAYS_TO;
-                         break;
-             case OMP_MAP_PRESENT_TOFROM:
-                         n->u.map.op = OMP_MAP_PRESENT_TO;
-                         break;
-             case OMP_MAP_ALWAYS_PRESENT_TOFROM:
-                         n->u.map.op = OMP_MAP_ALWAYS_PRESENT_TO;
-                         break;
-             default:
-                         gfc_error ("TARGET ENTER DATA with map-type other "
-                                    "than TO, TOFROM or ALLOC on MAP clause "
-                                    "at %L", &n->where);
-                         break;
-             }
+       switch (n->u.map.op)
+         {
+         case OMP_MAP_TO:
+         case OMP_MAP_ALWAYS_TO:
+         case OMP_MAP_PRESENT_TO:
+         case OMP_MAP_ALWAYS_PRESENT_TO:
+         case OMP_MAP_ALLOC:
+         case OMP_MAP_PRESENT_ALLOC:
+           break;
+         case OMP_MAP_TOFROM:
+           n->u.map.op = OMP_MAP_TO;
+           break;
+         case OMP_MAP_ALWAYS_TOFROM:
+           n->u.map.op = OMP_MAP_ALWAYS_TO;
            break;
+         case OMP_MAP_PRESENT_TOFROM:
+           n->u.map.op = OMP_MAP_PRESENT_TO;
+           break;
+         case OMP_MAP_ALWAYS_PRESENT_TOFROM:
+           n->u.map.op = OMP_MAP_ALWAYS_PRESENT_TO;
+           break;
+         default:
+           gfc_error ("TARGET ENTER DATA with map-type other "
+                      "than TO, TOFROM or ALLOC on MAP clause "
+                      "at %L", &n->where);
+           break;
+         }
+       break;
       case EXEC_OMP_TARGET_EXIT_DATA:
-           switch (n->u.map.op)
-             {
-             case OMP_MAP_FROM:
-             case OMP_MAP_ALWAYS_FROM:
-             case OMP_MAP_PRESENT_FROM:
-             case OMP_MAP_ALWAYS_PRESENT_FROM:
-             case OMP_MAP_RELEASE:
-             case OMP_MAP_DELETE:
-                         break;
-             case OMP_MAP_TOFROM:
-                         n->u.map.op = OMP_MAP_FROM;
-                         break;
-             case OMP_MAP_ALWAYS_TOFROM:
-                         n->u.map.op = OMP_MAP_ALWAYS_FROM;
-                         break;
-             case OMP_MAP_PRESENT_TOFROM:
-                         n->u.map.op = OMP_MAP_PRESENT_FROM;
-                         break;
-             case OMP_MAP_ALWAYS_PRESENT_TOFROM:
-                         n->u.map.op = OMP_MAP_ALWAYS_PRESENT_FROM;
-                         break;
-             default:
-                         gfc_error ("TARGET EXIT DATA with map-type other "
-                                    "than FROM, TOFROM, RELEASE, or DELETE on "
-                                    "MAP clause at %L", &n->where);
-                         break;
-             }
+       switch (n->u.map.op)
+         {
+         case OMP_MAP_FROM:
+         case OMP_MAP_ALWAYS_FROM:
+         case OMP_MAP_PRESENT_FROM:
+         case OMP_MAP_ALWAYS_PRESENT_FROM:
+         case OMP_MAP_RELEASE:
+         case OMP_MAP_DELETE:
            break;
-      default:
+         case OMP_MAP_TOFROM:
+           n->u.map.op = OMP_MAP_FROM;
+           break;
+         case OMP_MAP_ALWAYS_TOFROM:
+           n->u.map.op = OMP_MAP_ALWAYS_FROM;
+           break;
+         case OMP_MAP_PRESENT_TOFROM:
+           n->u.map.op = OMP_MAP_PRESENT_FROM;
+           break;
+         case OMP_MAP_ALWAYS_PRESENT_TOFROM:
+           n->u.map.op = OMP_MAP_ALWAYS_PRESENT_FROM;
            break;
+         default:
+           gfc_error ("TARGET EXIT DATA with map-type other "
+                      "than FROM, TOFROM, RELEASE, or DELETE on "
+                      "MAP clause at %L", &n->where);
+           break;
+         }
+       break;
+      default:
+       break;
       }
 
   if (list != OMP_LIST_DEPEND)

Reply via email to