Fortran: fix functions with entry and pointer/allocatable result [PR104312]
authorHarald Anlauf <anlauf@gmx.de>
Tue, 11 Apr 2023 19:44:20 +0000 (21:44 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Wed, 12 Apr 2023 09:08:59 +0000 (11:08 +0200)
commit2273fd5a6fdbe8f7da2c0e217c279bcbaaa7df9e
treec05ecfb6ca5f331aa0d68229c84e817cecaf1615
parentc482995cc5bac4a2168ea0049041e712544e474b
Fortran: fix functions with entry and pointer/allocatable result [PR104312]

gcc/fortran/ChangeLog:

PR fortran/104312
* resolve.cc (resolve_entries): Handle functions with ENTRY and
ALLOCATABLE results.
* trans-expr.cc (gfc_conv_procedure_call): Functions with a result
with the POINTER or ALLOCATABLE attribute shall not get any special
treatment with -ff2c, as they cannot be written in Fortran 77.
* trans-types.cc (gfc_return_by_reference): Likewise.
(gfc_get_function_type): Likewise.

gcc/testsuite/ChangeLog:

PR fortran/104312
* gfortran.dg/entry_26.f90: New test.
* gfortran.dg/entry_27.f90: New test.
gcc/fortran/resolve.cc
gcc/fortran/trans-expr.cc
gcc/fortran/trans-types.cc
gcc/testsuite/gfortran.dg/entry_26.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/entry_27.f90 [new file with mode: 0644]