Fix a function decl in gfortran

Tobias Burnus burnus@net-b.de
Wed Jun 4 06:13:00 GMT 2014


Tobias Burnus wrote:
> There are two functions groups called with mask, cf. iresolve.c's 
> gfc_resolve_minloc. Namely, without dim "mmin0_<kind>_<type>" and with 
> dim "mmin1_<kind>_<type>". – The latter takes "dim" as additional 
> argument.
>
> Thus, for mmin1_* the generated decl is fine, for mmin0_ is is not. I 
> do not immediately see where the "dim" argument is skipped – but some 
> similar special-case handling would then be also needed for the 
> function declaration.

To answer myself: gfc_conv_intrinsic_function sets "se->ignore_optional" 
– and, thus, dim= is not passed as actual argument.

I think what's needed is to modify gfc_copy_formal_args_intr – called by 
trans-intrinsic.c's gfc_get_symbol_for_expr – such that it optionally 
ignores absent optionals, i.e. passing expr->value.function.actual and 
walking it along the formal arguments, skipping the formal argument when 
actual->expr == NULL.

Tobias

PS: I have attached a completely untested draft patch.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: isym.diff
Type: text/x-patch
Size: 2477 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140604/33f96f50/attachment.bin>


More information about the Fortran mailing list