diff mbox

Fixup earlier commit to replace_uses_by

Message ID alpine.LNX.2.00.1112141632430.4527@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Dec. 14, 2011, 3:33 p.m. UTC
With SPEC 2k6 testing I noticed we fail to update &MEM[&a] when
propagating &a.  Fixed as follows.

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

Richard.

2011-12-14  Richard Guenther  <rguenther@suse.de>

	* tree-cfg.c (replace_uses_by): Fixup TREE_CONSTANT for
	propagating all kinds of constants.
diff mbox

Patch

Index: gcc/tree-cfg.c
===================================================================
--- gcc/tree-cfg.c	(revision 182328)
+++ gcc/tree-cfg.c	(working copy)
@@ -1612,8 +1612,8 @@  replace_uses_by (tree name, tree val)
 	  /* FIXME.  It shouldn't be required to keep TREE_CONSTANT
 	     on ADDR_EXPRs up-to-date on GIMPLE.  Propagation will
 	     only change sth from non-invariant to invariant, and only
-	     when propagating integer constants.  */
-	  if (TREE_CODE (val) == INTEGER_CST)
+	     when propagating constants.  */
+	  if (is_gimple_min_invariant (val))
 	    for (i = 0; i < gimple_num_ops (stmt); i++)
 	      {
 		tree op = gimple_op (stmt, i);