Patchwork Fix PR56288

login
register
mail settings
Submitter Richard Guenther
Date Feb. 12, 2013, 11:15 a.m.
Message ID <alpine.LNX.2.00.1302121214010.3394@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/219789/
State New
Headers show

Comments

Richard Guenther - Feb. 12, 2013, 11:15 a.m.
This fixes a oversight when introducing anonymous SSA names.
I managed to change a checking piece to a noop.  Oops.

I took the opportunity to move the freelist check earlier,
as the type check would trigger for freed SSA names as well.

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

Richard.

2013-02-12  Richard Biener  <rguenther@suse.de>

	PR middle-end/56288
	* tree-ssa.c (verify_ssa_name): Fix check, move
	SSA_NAME_IN_FREE_LIST check up.

Patch

Index: gcc/tree-ssa.c
===================================================================
--- gcc/tree-ssa.c	(revision 195941)
+++ gcc/tree-ssa.c	(working copy)
@@ -626,16 +626,16 @@  verify_ssa_name (tree ssa_name, bool is_
       return true;
     }
 
-  if (SSA_NAME_VAR (ssa_name) != NULL_TREE
-      && TREE_TYPE (ssa_name) != TREE_TYPE (ssa_name))
+  if (SSA_NAME_IN_FREE_LIST (ssa_name))
     {
-      error ("type mismatch between an SSA_NAME and its symbol");
+      error ("found an SSA_NAME that had been released into the free pool");
       return true;
     }
 
-  if (SSA_NAME_IN_FREE_LIST (ssa_name))
+  if (SSA_NAME_VAR (ssa_name) != NULL_TREE
+      && TREE_TYPE (ssa_name) != TREE_TYPE (SSA_NAME_VAR (ssa_name)))
     {
-      error ("found an SSA_NAME that had been released into the free pool");
+      error ("type mismatch between an SSA_NAME and its symbol");
       return true;
     }