summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-09 12:48:34 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-09 12:48:34 +0000
commit4b9edb63d74b46c67657accfdb1a16318ae6afba (patch)
treef58b12d17bea68e37c033b2a78f7510cc54c9640 /gcc/tree-ssa-loop-niter.c
parent40af37bd8a38976ca6f41af80c5f700e42002d66 (diff)
downloadgcc-4b9edb63d74b46c67657accfdb1a16318ae6afba.tar.gz
2010-06-09 Richard Guenther <rguenther@suse.de>
* tree-ssa-loop-niter.c (simplify_replace_tree): Do not replace constants. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160467 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index accf17a4c23..170fb22ca4c 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -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);