This is the mail archive of the 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]

[PATCH] Fix PR44911

This fixes multi-line output from dumping MEM_REF and also crashes
from endless recursions of TYPE_DECLs without a name.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

2010-07-13  Richard Guenther  <>

	PR middle-end/44911
	* tree-pretty-print.c (dump_generic_node): Use TDF_SLIM for
	MEM_REF pointer type dumping.  Avoid recursing for TYPE_DECLs
	without name.

Index: gcc/tree-pretty-print.c
--- gcc/tree-pretty-print.c	(revision 162126)
+++ gcc/tree-pretty-print.c	(working copy)
@@ -828,7 +828,7 @@ dump_generic_node (pretty_printer *buffe
 	    pp_string (buffer, "MEM[");
 	    pp_string (buffer, "(");
 	    dump_generic_node (buffer, TREE_TYPE (TREE_OPERAND (node, 1)),
-			       spc, flags, false);
+			       spc, flags | TDF_SLIM, false);
 	    pp_string (buffer, ")");
 	    dump_generic_node (buffer, TREE_OPERAND (node, 0),
 			       spc, flags, false);
@@ -1113,7 +1113,7 @@ dump_generic_node (pretty_printer *buffe
       if (DECL_NAME (node))
 	dump_decl_name (buffer, node, flags);
-      else
+      else if (TYPE_NAME (TREE_TYPE (node)) != node)
 	  if ((TREE_CODE (TREE_TYPE (node)) == RECORD_TYPE
 	       || TREE_CODE (TREE_TYPE (node)) == UNION_TYPE)
@@ -1132,6 +1132,8 @@ dump_generic_node (pretty_printer *buffe
 	      dump_generic_node (buffer, TREE_TYPE (node), spc, flags, false);
+      else
+	pp_string (buffer, "<anon>");
     case VAR_DECL:

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