]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: fix treatment of character, value, optional dummy arguments [PR107444]
authorHarald Anlauf <anlauf@gmx.de>
Thu, 10 Nov 2022 21:30:27 +0000 (22:30 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Sat, 12 Nov 2022 20:03:28 +0000 (21:03 +0100)
commit59a63247992eb13153b82c4902aadf111460eac2
treebe43ce02582ae5ddd62d4d5f542891da8288e8d5
parentb556d1773db7174c71c466d9b3cafc25c7d6c825
Fortran: fix treatment of character, value, optional dummy arguments [PR107444]

Fix handling of character dummy arguments that have the optional+value
attribute.  Change name of internal symbols that carry the hidden presence
status of optional arguments to distinguish them from the internal hidden
character length.  Update documentation to clarify the gfortran ABI.

gcc/fortran/ChangeLog:

PR fortran/107444
* trans-decl.cc (create_function_arglist): Extend presence status
to all intrinsic types, and change prefix of internal symbol to '.'.
* trans-expr.cc (gfc_conv_expr_present): Align to changes in
create_function_arglist.
(gfc_conv_procedure_call): Fix generation of procedure arguments for
the case of character dummy arguments with optional+value attribute.
* trans-types.cc (gfc_get_function_type): Synchronize with changes
to create_function_arglist.
* doc/gfortran/naming-and-argument-passing-conventions.rst: Clarify
the gfortran argument passing conventions with regard to OPTIONAL
dummy arguments of intrinsic type.

gcc/testsuite/ChangeLog:

PR fortran/107444
* gfortran.dg/optional_absent_7.f90: Adjust regex.
* gfortran.dg/optional_absent_8.f90: New test.
gcc/fortran/doc/gfortran/naming-and-argument-passing-conventions.rst
gcc/fortran/trans-decl.cc
gcc/fortran/trans-expr.cc
gcc/fortran/trans-types.cc
gcc/testsuite/gfortran.dg/optional_absent_7.f90
gcc/testsuite/gfortran.dg/optional_absent_8.f90 [new file with mode: 0644]