[Patch, Fortran] PR 44430: [4.5/4.6 Regression] Infinite recursion with -fdump-parse-tree
Janus Weil
janus@gcc.gnu.org
Mon Jun 7 23:28:00 GMT 2010
Hi Mikael,
thanks for your review!
> I'm not sure this is right.
> from gfc_symbol in gfortran.h :
> struct gfc_namespace *ns; /* namespace containing this symbol */
>
> IIUC, ns is the parent namespace and formal_ns the local namespace. I don't
> see how they could be the same.
Yeah, well, actually they're only the same in the test case, since
there is no other namespace outside of 'foo' and therefore the
procedure symbol is inside it's own local namespace.
> OK, the symbols are the same, and thus their namespaces are the same.
> It would be more obvious from my point of view to test sym against
> sym->ns->proc_name instead of their namespaces.
You're completely right. In particular this will also work if the
subroutine is placed in a module, while my previous patch would fail
in such a situation.
The attached new patch is what I will commit once I have figured out a
proper test case.
Cheers,
Janus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr44430.diff
Type: application/octet-stream
Size: 428 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20100607/86226b3b/attachment.obj>
More information about the Fortran
mailing list