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: PATCH: fortran/26041: FORTRAN compiler won't compile the valid code


Hongjiu,

:REVIEWMAIL:

Depending on the order of the code, resolve_code may be called before
symbols are resolved. This patch tries to resolve symbols before
calling resolve_code. Tested on Linux/i686.




It turns out that resolve_code has to be called in the right order. I am testing this on Linux/x86-64 now.


This manifestly the right thing to be doing. I have one question and a few comments, subject to which this patch is OK to commit.

I have regtested it on FC3/Athlon and have run NIST and all the Meissner testcases with it; all looks fine.

The question concerns the recursion into resolve_entries. You do nothing that was not done before for this function but since we are about it, I wonder if it is meant to visit contained procedures twice or more? Since gfc_resolve_type recurses into contained procedures, everybody gets visited via the direct call. However, resolve_contained_functions also visits contained procedures and calls resolve_entries in the process. None of the other function calls can result in such revisits, as far as I can tell.


H.J. ---- 2006-01-31 H.J. Lu <hongjiu.lu@intel.com>

    PR fortran/26041
    PR fortran/26064
    * resolve.c (gfc_resolve_type): New function.
    (gfc_resolve_code): Likewise.
    (gfc_resolve): Use them.

Please be a little bit more descriptive; A sentence for each on what the new functions do and what was done to gfc_resolve will be enough. eg.:

* resolve.c (gfc_resolve_type): New function that does everything that the
original gfc_resolve did, except code_resolution.
(gfc_resolve_code): New function for code resolution that recurses through
contained namespaces.
(gfc_resolve): Calls gfc_resolve_type and gfc_resolve_code to do everything
previously done by the function of this name.


I am not convinced about the name gfc_resolve_type. At very least, it should be gfc_resolve_types. It is a pity that resolve_symbol has gone... how about gfc_resolve_entities, to use the terminology of the standard? (This is not a drop dead issue for me, though!)

Finally, we have stopped naming testcases pr*****.f90 and give them more descriptive names, instead. Look through gfortran.dg to get the idea. Also, it would be nice to have a one sentence comment as to what the PR was.

Many thanks!

Paul Thomas




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