[PATCH] Initialize has_constants properly for insertions in SCCVN

Richard Guenther rguenther@suse.de
Mon May 26 16:51:00 GMT 2008


We happen to have (foo *)&bar sometimes, so initialize has_constants
properly.

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

Richard.

2008-05-26  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-sccvn.c (expr_has_constants): Declare.
	(visit_reference_op_load): Initialize VN_INFO->has_constants
	properly.

Index: tree-ssa-sccvn.c
===================================================================
--- tree-ssa-sccvn.c	(revision 135912)
+++ tree-ssa-sccvn.c	(working copy)
@@ -1139,8 +1139,8 @@ defs_to_varying (tree stmt)
   return changed;
 }
 
-static tree
-try_to_simplify (tree stmt, tree rhs);
+static bool expr_has_constants (tree expr);
+static tree try_to_simplify (tree stmt, tree rhs);
 
 /* Visit a copy between LHS and RHS, return true if the value number
    changed.  */
@@ -1245,6 +1245,7 @@ visit_reference_op_load (tree lhs, tree 
 	  /* Initialize value-number information properly.  */
 	  VN_INFO_GET (result)->valnum = result;
 	  VN_INFO (result)->expr = val;
+	  VN_INFO (result)->has_constants = expr_has_constants (val);
 	  VN_INFO (result)->needs_insertion = true;
 	  /* As all "inserted" statements are singleton SCCs, insert
 	     to the valid table.  This is strictly needed to



More information about the Gcc-patches mailing list