public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-12] Fix: Fortran/OpenMP: align/allocator modifiers to the allocate clause
@ 2023-02-22 11:39 Tobias Burnus
  0 siblings, 0 replies; only message in thread
From: Tobias Burnus @ 2023-02-22 11:39 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:cbd92239ae10fdc8abc69355fd4397473cdf5950

commit cbd92239ae10fdc8abc69355fd4397473cdf5950
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Wed Feb 22 12:35:29 2023 +0100

    Fix: Fortran/OpenMP: align/allocator modifiers to the allocate clause
    
    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.

Diff:
---
 gcc/fortran/ChangeLog.omp   |  5 +++++
 gcc/fortran/trans-openmp.cc | 16 ++++++++--------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/gcc/fortran/ChangeLog.omp b/gcc/fortran/ChangeLog.omp
index f6ee8726c8d..672bc02e2f6 100644
--- a/gcc/fortran/ChangeLog.omp
+++ b/gcc/fortran/ChangeLog.omp
@@ -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:
diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc
index de42fe48de4..9188a31dcbf 100644
--- a/gcc/fortran/trans-openmp.cc
+++ b/gcc/fortran/trans-openmp.cc
@@ -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);
 		  }
 	      }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-22 11:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22 11:39 [gcc/devel/omp/gcc-12] Fix: Fortran/OpenMP: align/allocator modifiers to the allocate clause Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).