diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2023-02-22 12:35:29 +0100 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2023-02-22 12:35:29 +0100 |
commit | cbd92239ae10fdc8abc69355fd4397473cdf5950 (patch) | |
tree | d421d408d5a91190721f7c1be2abd5d300d70070 /gcc | |
parent | 9657d906869e098340c23118c2eb8592d9e77ac5 (diff) | |
download | gcc-cbd92239ae10fdc8abc69355fd4397473cdf5950.zip gcc-cbd92239ae10fdc8abc69355fd4397473cdf5950.tar.gz gcc-cbd92239ae10fdc8abc69355fd4397473cdf5950.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog.omp | 5 | ||||
-rw-r--r-- | 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 f6ee872..672bc02 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 de42fe4..9188a31 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); } } |