[PATCH] Fix PR53541

Richard Guenther rguenther@suse.de
Thu May 31 15:02:00 GMT 2012


This backports a fix for dumping.

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

Richard.

2012-05-31  Richard Guenther  <rguenther@suse.de>

	PR middle-end/53541
	* tree-pretty-print.c (dump_generic_node): Guard against
	NULL_TREE TREE_TYPE when dumping MEM_REF offset type.

Index: gcc/tree-pretty-print.c
===================================================================
--- gcc/tree-pretty-print.c	(revision 188064)
+++ gcc/tree-pretty-print.c	(working copy)
@@ -805,6 +805,8 @@ dump_generic_node (pretty_printer *buffe
 	       infer them and MEM_ATTR caching will share MEM_REFs
 	       with differently-typed op0s.  */
 	    && TREE_CODE (TREE_OPERAND (node, 0)) != INTEGER_CST
+	    /* Released SSA_NAMES have no TREE_TYPE.  */
+	    && TREE_TYPE (TREE_OPERAND (node, 0)) != NULL_TREE
 	    /* Same pointer types, but ignoring POINTER_TYPE vs.
 	       REFERENCE_TYPE.  */
 	    && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 0)))
@@ -1171,6 +1173,8 @@ dump_generic_node (pretty_printer *buffe
 		     can't infer them and MEM_ATTR caching will share
 		     MEM_REFs with differently-typed op0s.  */
 		  && TREE_CODE (TREE_OPERAND (op0, 0)) != INTEGER_CST
+		  /* Released SSA_NAMES have no TREE_TYPE.  */
+		  && TREE_TYPE (TREE_OPERAND (op0, 0)) != NULL_TREE
 		  /* Same pointer types, but ignoring POINTER_TYPE vs.
 		     REFERENCE_TYPE.  */
 		  && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 0)))



More information about the Gcc-patches mailing list