Patchwork [fortran,committed] Avoid infinite recursion in -fdump-fortran-original

login
register
mail settings
Submitter Thomas Koenig
Date Dec. 3, 2010, 12:25 p.m.
Message ID <1291379129.7162.6.camel@linux-fd1f.site>
Download mbox | patch
Permalink /patch/74129/
State New
Headers show

Comments

Thomas Koenig - Dec. 3, 2010, 12:25 p.m.
Hello world,

the attached patch was committed as obvious as rev. 167416.  I mentioned
the PR in the changelog because that was the test case I found the bug
in.

	Thomas 

2010-12-03  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/44352
	* dump-parse-tree.c (show_symbol):  Don't show formal namespace
	for statement functions in order to avoid infinite recursion.

Patch

Index: dump-parse-tree.c
===================================================================
--- dump-parse-tree.c	(Revision 167365)
+++ dump-parse-tree.c	(Arbeitskopie)
@@ -889,7 +889,8 @@  show_symbol (gfc_symbol *sym)
 	}
     }
 
-  if (sym->formal_ns && (sym->formal_ns->proc_name != sym))
+  if (sym->formal_ns && (sym->formal_ns->proc_name != sym)
+      && sym->attr.proc != PROC_ST_FUNCTION)
     {
       show_indent ();
       fputs ("Formal namespace", dumpfile);