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]

[PATCH][mem-ref2] Adjust mem-ref dumping


Print MEM[&a] in the usal fancy way (a).

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

Richard.

2010-06-08  Richard Guenther  <rguenther@suse.de>

	* tree-pretty-print.c (dump_generic_node): Print MEM[&a] in
	the usual fancy way.

Index: gcc/tree-pretty-print.c
===================================================================
--- gcc/tree-pretty-print.c	(revision 160434)
+++ gcc/tree-pretty-print.c	(working copy)
@@ -796,16 +796,23 @@ dump_generic_node (pretty_printer *buffe
 
     case MEM_REF:
       {
-	if (TREE_CODE (TREE_OPERAND (node, 0)) != ADDR_EXPR
-	    && integer_zerop (TREE_OPERAND (node, 1))
+	if (integer_zerop (TREE_OPERAND (node, 1))
 	    && (TREE_TYPE (TREE_OPERAND (node, 0))
 		== TREE_TYPE (TREE_OPERAND (node, 1)))
 	    && (TYPE_MAIN_VARIANT (TREE_TYPE (node))
-		== TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 1))))))
+		== TYPE_MAIN_VARIANT
+		    (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 1))))))
 	  {
-	    pp_string (buffer, "*");
-	    dump_generic_node (buffer, TREE_OPERAND (node, 0),
-			       spc, flags, false);
+	    if (TREE_CODE (TREE_OPERAND (node, 0)) != ADDR_EXPR)
+	      {
+		pp_string (buffer, "*");
+		dump_generic_node (buffer, TREE_OPERAND (node, 0),
+				   spc, flags, false);
+	      }
+	    else
+	      dump_generic_node (buffer,
+				 TREE_OPERAND (TREE_OPERAND (node, 0), 0),
+				 spc, flags, false);
 	  }
 	else
 	  {
@@ -814,7 +821,8 @@ dump_generic_node (pretty_printer *buffe
 	    dump_generic_node (buffer, TREE_TYPE (TREE_OPERAND (node, 1)),
 			       spc, flags, false);
 	    pp_string (buffer, ")");
-	    dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
+	    dump_generic_node (buffer, TREE_OPERAND (node, 0),
+			       spc, flags, false);
 	    if (!integer_zerop (TREE_OPERAND (node, 1)))
 	      {
 		pp_string (buffer, " + ");
@@ -1140,7 +1148,8 @@ dump_generic_node (pretty_printer *buffe
 		  && (TREE_TYPE (TREE_OPERAND (op0, 0))
 		      == TREE_TYPE (TREE_OPERAND (op0, 1)))
 		  && (TYPE_MAIN_VARIANT (TREE_TYPE (op0))
-		      == TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 1))))))))
+		      == TYPE_MAIN_VARIANT
+		          (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 1))))))))
 	{
 	  op0 = TREE_OPERAND (op0, 0);
 	  str = "->";


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