tree-ssa-loop-niter.c (simplify_replace_tree): Do not replace constants.

2010-06-09  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-loop-niter.c (simplify_replace_tree): Do not
	replace constants.

From-SVN: r160467
This commit is contained in:
Richard Guenther 2010-06-09 12:48:34 +00:00 committed by Richard Biener
parent 37b28a3582
commit 76c857431e
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2010-06-09 Richard Guenther <rguenther@suse.de>
* tree-ssa-loop-niter.c (simplify_replace_tree): Do not
replace constants.
2010-06-09 Kai Tietz <kai.tietz@onevision.com>
* c-objc-common.c (c_tree_printer): Pre-intialize t by NULL_TREE.

View File

@ -1374,6 +1374,10 @@ simplify_replace_tree (tree expr, tree old, tree new_tree)
if (!expr)
return NULL_TREE;
/* Do not bother to replace constants. */
if (CONSTANT_CLASS_P (old))
return expr;
if (expr == old
|| operand_equal_p (expr, old, 0))
return unshare_expr (new_tree);