Le 28/10/2022 à 22:12, Harald Anlauf via Fortran a écrit :
Dear all,

the passing of procedure arguments in Fortran sometimes requires
ancillary parameters that are "hidden".  Examples are string length
and the presence status of scalar variables with optional+value
attribute.

The gfortran ABI is actually documented:

https://gcc.gnu.org/onlinedocs/gfortran/Argument-passing-conventions.html

The reporter found that there was a discrepancy between the
caller and the callee.  This is corrected by the attached patch.

Hello,

I think some discrepancy remains, as gfc_conv_procedure_call accumulates coarray stuff into the stringargs, while your change accumulates the associated parameter decls separately into hidden_arglist. It's not completely clear to me whether it is really problematic (string length and coarray metadata are both integers anyway), but I suspect it is.

Another probable issue is your change to create_function_arglist changes arglist/hidden_arglist without also changing typelist/hidden_typelist accordingly. I think a change to gfc_get_function_type is also necessary: as the function decl is changed, the decl type need to be changed as well.

I will see whether I can manage to exhibit testcases for these issues.

Reply via email to