[Patch] Fortran: Fixes for pointer function call as variable (PR96896)
Tobias Burnus
tobias@codesourcery.com
Wed Sep 2 15:02:49 GMT 2020
During some discussion such an example as attached came up:
f() = 0.0
where 'f' is a function which returns a pointer to an array.
This gets handled as
_F.D0 => f()
_F.D0 = 0.0
However, the first line did fail with a rank error as the rank
was taken from the RHS.
Changing this to the LHS express failed due to 'use_assoc',
which added an 'extern' to the variable and 'proc_pointer'
also caused problems – in principle, either problem could
have also occurred for the RHS.
Side effect: The error message is better for rank mismatch
as for 'f() = a' no pointer assignment is involved (in terms
of the user code) but before we had the error message
'Different ranks in pointer assignment'.
OK?
Tobias
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ptrfunc.diff
Type: text/x-patch
Size: 3600 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20200902/0399a584/attachment.bin>
More information about the Fortran
mailing list