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] |

*From*: Brooks Moses <brooks dot moses at codesourcery dot com>*To*: "Lee Millward" <lee dot millward at codesourcery dot com>*Cc*: gcc-patches at gcc dot gnu dot org,fortran at gcc dot gnu dot org*Date*: Tue, 08 May 2007 11:30:35 -0700*Subject*: Re: [fortran patch] Don't use TREE_LISTs for storing arguments to intrinsic functions*References*: <46402258.5030706@codesourcery.com> <9784d3ab0705071520k1f0c1563ib16810e65852924a@mail.gmail.com> <46402258.5030706@codesourcery.com>

> +{ > + 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

**Follow-Ups**:

**References**:

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |