[Patch, Fortran] PR 44430: [4.5/4.6 Regression] Infinite recursion with -fdump-parse-tree

Janus Weil janus@gcc.gnu.org
Mon Jun 7 02:53:00 GMT 2010


Hi all,

here is the fix for a regression introduced by one of my procedure
pointer patches last year (r149586). One of the things this patch did
was to give a formal_ns to all procedures (before that, the formal_ns
field was only used for interfaces, I think). Now this creates a
problem for -fdump-parse-tree if the formal_ns coincides with the
local namespace of the procedure (which is usually the case for normal
functions and subroutines): Dumping the procedure symbol includes
dumping the formal_ns, which again contains the procedure symbol, so
that we end up in an infinite loop. My fix avoids this by checking if
the formal_ns is the same as the procedure ns.

The patch was regtested on x86_64-unknown-linux-gnu without failures.
Ok for trunk and 4.5?

Also: Should I include a test case when committing this patch? And if
yes, what should it look like? I haven't found any test cases for
-fdump-parse-tree in the test suite ...

Cheers,
Janus


2010-06-06  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/44430
	* dump-parse-tree.c (show_symbol): Avoid infinite loop.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr44430.diff
Type: application/octet-stream
Size: 421 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100607/735b9019/attachment.obj>


More information about the Gcc-patches mailing list