[PATCH] Fortran: fix functions with entry and pointer/allocatable result [PR104312]
Harald Anlauf
anlauf@gmx.de
Tue Apr 11 20:12:39 GMT 2023
Dear all,
the testcase in the PR by Gerhard exhibited a mis-treatment of
the function decl of the entry master if the function result
had a pointer attribute and the translation unit was compiled
with -ff2c. We actually should not use the peculiar special
treatment for default-real functions in that case, as -ff2c is
reserved for function results that can be expressed in Fortran77,
and POINTER was not allowed in that standard. Same for complex.
Furthermore, it turned out that ALLOCATABLE function results
were not yet handled for functions with entries, even without
-ff2c. Adding support for this was straightforward.
I also fixed a potential buffer overflow for a generated
internal symbol.
Regtested on x86_64-pc-linux-gnu. OK for mainline?
Thanks,
Harald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr104312.diff
Type: text/x-patch
Size: 7266 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20230411/7a934889/attachment.bin>
More information about the Fortran
mailing list