Patchwork Fix PR53541

login
register
mail settings
Submitter Richard Guenther
Date May 31, 2012, 3:01 p.m.
Message ID <Pine.LNX.4.64.1205311701110.5860@jbgna.fhfr.qr>
Download mbox | patch
Permalink /patch/162177/
State New
Headers show

Comments

Richard Guenther - May 31, 2012, 3:01 p.m.
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.

Patch

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)))