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

FX Coudert fxcoudert@gmail.com
Sun Jul 15 00:29:00 GMT 2007


Hi Lee,

Sorry it took so much time for me to take time and read through your  
new patch, but here I am... The patch is OK, with the following  
modifications:

   * your testcases need to have a "! { dg-do run }" (without quotes)  
line; every Fortran source file in gcc/testsuite/gfortran.dg should  
have at least a dg-do directive (compile, link, run, ...)

   * once again, you have a problem with gfc_conv_intrinsic_minmax:
>    mvar = gfc_create_var (type, "M");
>    elsecase = build2_v (MODIFY_EXPR, mvar, limit);
> -  for (arg = TREE_CHAIN (arg), i = 0, argexpr = argexpr->next;
> -       arg != NULL_TREE; arg = TREE_CHAIN (arg), i++)
> +  for (i = 0; i < nargs; i++)
>      {
>        tree cond;
The new loop should be changed into "for (i = 1; i < nargs; i++)";  
for MIN or MAX, we generate a series of comparisons; the first  
comparison is to compare arg[1] with arg[0], not arg[0] with itself.


Other than that, I've not spotted any error. Of course, these long  
mechanical patches tend to be hard to write and review, and thus  
prone to errors; please keep in touch with the fortran mailing-list  
in the next week so that you can quickly spot any suspicious issue.

Thanks again for your hard work,
FX



More information about the Fortran mailing list