From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1534) id 0158B3858D3C; Wed, 22 Feb 2023 11:39:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0158B3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677065968; bh=IqBaoVL0O7C2ID+ttrweijne8ufMfoIyux1DqW3EhZg=; h=From:To:Subject:Date:From; b=RenFdTOrUc6umK8duLlvzmOulBwRjPC6nSbrstkzC9wsIpH7cCjZyL61+3iJrJyFS ayPxNCwDIfMXmyBsaHRDeyK7SJZ6lBNOjWXGp5LYNne7FwhXn+4GMnpcC4E1nK3/FE Mxke+0xIuD9xhqUT/twLWelaBuGK27KZy/l4Q2XM= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tobias Burnus To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/omp/gcc-12] Fix: Fortran/OpenMP: align/allocator modifiers to the allocate clause X-Act-Checkin: gcc X-Git-Author: Tobias Burnus X-Git-Refname: refs/heads/devel/omp/gcc-12 X-Git-Oldrev: 9657d906869e098340c23118c2eb8592d9e77ac5 X-Git-Newrev: cbd92239ae10fdc8abc69355fd4397473cdf5950 Message-Id: <20230222113928.0158B3858D3C@sourceware.org> Date: Wed, 22 Feb 2023 11:39:28 +0000 (GMT) List-Id: https://gcc.gnu.org/g:cbd92239ae10fdc8abc69355fd4397473cdf5950 commit cbd92239ae10fdc8abc69355fd4397473cdf5950 Author: Tobias Burnus 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 + + * trans-openmp.cc (gfc_trans_omp_clauses): Move align modifier + handling from OMP_LIST_ALLOCATOR to OMP_LIST_ALLOCATE. + 2023-02-15 Tobias Burnus 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); } }