> +{
> + int n = 0;
> + gfc_actual_arglist *actual;
> + gfc_intrinsic_arg *formal = expr->value.function.isym->formal;;
There is no need for formal in this function; it is never used.
> +
> + for (actual = expr->value.function.actual; actual; actual =
actual->next,
> + formal = formal ? formal->next : NULL)
Similarly, the whole second line of this is irrelevant.
Previous versions of the patch didn't use formal for calculating the
number of arguments but this led to discrepencies in the number of
arguments returned from this function and the number expected by
gfc_conv_intrinsic_function_args. Since the two are meant to work in
conjunction with each other I adjusted this to make it behave the same
as gfc_conv_intrinsic_function_args since it was causing ICEs and
wrong-code problems in the testsuite.