[Patch, fortran] PR31692 - Wrong code when passing function name as result to procedures

Paul Richard Thomas paul.richard.thomas@gmail.com
Tue May 8 04:49:00 GMT 2007


FX,

> Mis-indentation of this last line?

I'll take a look see, when I reapply it to do the commit.
>
> I think "g77 && ..." would be way better than "g77 == 1 && ...". E.g.
> I spent some time to look if g77 could have other integer values (the
> all too common magical values

No, g77 is clean in that respect.
>
> > +   /* Is this the result of the enclosing procedure?  */
> > +   this_array_result = (full_array_var && sym->attr.flavor ==
> > FL_PROCEDURE);
> > +   if (this_array_result)
> > +     {
> > +       this_array_result = (sym->backend_decl ==
> > current_function_decl);
> > +       this_array_result |= (sym->backend_decl == parent);
> > +     }
>
> Why not the following?
>
> +   /* Is this the result of the enclosing procedure?  */
> +   if (full_array_var && sym->attr.flavor == FL_PROCEDURE)
> +     this_array_result = sym->backend_decl == current_function_decl
> +                         || sym->backend_decl == parent;
> +   else
> +     this_array_result = false;
>

I was trying to make the logic as transparent as possible.

>
> Other than that, it's OK for me. The preexisting logic of this code
> is not crystal-clear, but hopefully we won't have it to change it
> every other day! :)

How about I comment it, whilst I am about it?

Thanks for the three reviews, FX.  I'll do some committing today.

Cheers

Paul


-- 
"Success is the ability to go from one failure to another with no loss
of enthusiasm."  -  Winston Churchill



More information about the Fortran mailing list