This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [fortran patch] Don't use TREE_LISTs for storing arguments to intrinsic functions


Hello, Lee,

At 11:16 AM 5/8/2007, Lee Millward wrote:
> +{
> +  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.

I'm still baffled by this, then. The two lines that I quoted are the only uses of formal in this function, right? As far as I can see, neither of them affects the number of iterations of the loop or the calculation of the number of arguments, unless I'm completely missing something. Could you please lead me through how this works?


Thanks,
- Brooks


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]