]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix: Fortran/OpenMP: align/allocator modifiers to the allocate clause
authorTobias Burnus <tobias@codesourcery.com>
Wed, 22 Feb 2023 11:35:29 +0000 (12:35 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Wed, 22 Feb 2023 11:35:29 +0000 (12:35 +0100)
When merging r13-4584-gb2e1c49b4a4 to OG12 as commit 58e0579ed87,
the 'align' handling seemingly ended up in the wrong clause.
(Result: libgomp.fortran/allocate-2a.f90 FAILED; now fixed.)

gcc/fortran/
* trans-openmp.cc (gfc_trans_omp_clauses): Move align modifier
handling from OMP_LIST_ALLOCATOR to OMP_LIST_ALLOCATE.

gcc/fortran/ChangeLog.omp
gcc/fortran/trans-openmp.cc

index f6ee8726c8da20d1b986692460daf566b37deb60..672bc02e2f61e84010fa162ab00d85749ecd53fb 100644 (file)
@@ -1,3 +1,8 @@
+2023-02-22  Tobias Burnus  <tobias@codesourcery.com>
+
+       * trans-openmp.cc (gfc_trans_omp_clauses): Move align modifier
+       handling from OMP_LIST_ALLOCATOR to OMP_LIST_ALLOCATE.
+
 2023-02-15  Tobias Burnus  <tobias@codesourcery.com>
 
        Backported from master:
index de42fe48de4e7dfcb644d5862e303e3baae2e2de..9188a31dcbfaae8f5531166da72a0f2963c5cf8f 100644 (file)
@@ -4104,6 +4104,14 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
                          }
                        OMP_CLAUSE_ALLOCATE_ALLOCATOR (node) = allocator_;
                      }
+                   if (n->u.align)
+                     {
+                       tree align_;
+                       gfc_init_se (&se, NULL);
+                       gfc_conv_expr (&se, n->u.align);
+                       align_ = gfc_evaluate_now (se.expr, block);
+                       OMP_CLAUSE_ALLOCATE_ALIGN (node) = align_;
+                     }
                    omp_clauses = gfc_trans_add_clause (node, omp_clauses);
                  }
              }
@@ -4126,14 +4134,6 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
                        allocator_ = gfc_evaluate_now (se.expr, block);
                        OMP_ALLOCATE_ALLOCATOR (node) = allocator_;
                      }
-                   if (n->u.align)
-                     {
-                       tree align_;
-                       gfc_init_se (&se, NULL);
-                       gfc_conv_expr (&se, n->u.align);
-                       align_ = gfc_evaluate_now (se.expr, block);
-                       OMP_CLAUSE_ALLOCATE_ALIGN (node) = align_;
-                     }
                    omp_clauses = gfc_trans_add_clause (node, omp_clauses);
                  }
              }