]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Fix [Coarray] ICE in conv_caf_send, at fortran/trans-intrinsic.c:1950 [PR84246]
authorAndre Vehreschild <vehre@gcc.gnu.org>
Wed, 17 Jul 2024 10:30:52 +0000 (12:30 +0200)
committerAndre Vehreschild <vehre@gcc.gnu.org>
Tue, 20 Aug 2024 07:32:09 +0000 (09:32 +0200)
commit35f56012806432fd89bbae431950a8dc5f6729a3
tree181c1a99cac8d233d4a424b1de931f1116b7d722
parentdb2e9a2a46f64b037494e8300c46f2d90a9fa55c
Fortran: Fix [Coarray] ICE in conv_caf_send, at fortran/trans-intrinsic.c:1950 [PR84246]

Fix ICE caused by converted expression already being pointer by checking
for its type.  Lift rewrite to caf_send completely into resolve and
prevent more temporary arrays.

PR fortran/84246

gcc/fortran/ChangeLog:

* resolve.cc (caf_possible_reallocate): Detect arrays that may
be reallocated by caf_send.
(resolve_ordinary_assign): More reliably detect assignments
where a rewrite to caf_send is needed.
* trans-expr.cc (gfc_trans_assignment_1): Remove rewrite to
caf_send, because this is done by resolve now.
* trans-intrinsic.cc (conv_caf_send): Prevent unneeded temporary
arrays.

libgfortran/ChangeLog:

* caf/single.c (send_by_ref): Created array's lbound is now 1
and the offset set correctly.

gcc/testsuite/ChangeLog:

* gfortran.dg/coarray_allocate_7.f08: Adapt to array being
allocate by caf_send.
gcc/fortran/resolve.cc
gcc/fortran/trans-expr.cc
gcc/fortran/trans-intrinsic.cc
gcc/testsuite/gfortran.dg/coarray_allocate_7.f08
libgfortran/caf/single.c