Fix PR 94578.
authorThomas König <tkoenig@gcc.gnu.org>
Sat, 25 Apr 2020 10:28:15 +0000 (12:28 +0200)
committerThomas König <tkoenig@gcc.gnu.org>
Sat, 25 Apr 2020 10:28:15 +0000 (12:28 +0200)
commitcf3f7b309ffdd888fdd85048ac9b4bcdc2713a45
tree9176ecce77f2ef37f511c9ca626c7f8fe0947fba
parentead1c27a5308e8ff3bae6d663c8890d4b24da7c3
Fix PR 94578.

Our intrinsics do not handle spans on their return values (yet),
so this creates a temporary for subref array pointers.

2020-04-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/94578
* trans-expr.c (arrayfunc_assign_needs_temporary): If the
LHS is a subref pointer, we also need a temporary.

2020-04-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/94578
* gfortran.dg/pointer_assign_14.f90: New test.
* gfortran.dg/pointer_assign_15.f90: New test.
gcc/fortran/trans-expr.c
gcc/testsuite/gfortran.dg/pointer_assign_14.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/pointer_assign_15.f90 [new file with mode: 0644]