]> gcc.gnu.org Git - gcc.git/commit
Fortran: ALLOCATE statement, SOURCE/MOLD expressions with subrefs [PR114024]
authorSteve Kargl <kargl@gcc.gnu.org>
Fri, 23 Feb 2024 21:05:04 +0000 (22:05 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Wed, 6 Mar 2024 20:38:06 +0000 (21:38 +0100)
commit77cf842869ddda8cfcdbb7db6e65ecfb9ac432fc
treedef3f5fa3d533c0a721c437b1b95d4b4834ef855
parent7b34983807204e7d94c3887cb12f0a0243efceac
Fortran: ALLOCATE statement, SOURCE/MOLD expressions with subrefs [PR114024]

PR fortran/114024

gcc/fortran/ChangeLog:

* trans-stmt.cc (gfc_trans_allocate): When a source expression has
substring references, part-refs, or %re/%im inquiries, wrap the
entity in parentheses to force evaluation of the expression.

gcc/testsuite/ChangeLog:

* gfortran.dg/allocate_with_source_27.f90: New test.
* gfortran.dg/allocate_with_source_28.f90: New test.

Co-Authored-By: Harald Anlauf <anlauf@gmx.de>
(cherry picked from commit 80d126ba99f4b9bc64d4861b3c4bae666497f2d4)
gcc/fortran/trans-stmt.cc
gcc/testsuite/gfortran.dg/allocate_with_source_27.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/allocate_with_source_28.f90 [new file with mode: 0644]
This page took 0.083415 seconds and 6 git commands to generate.