summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-16 15:45:09 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-16 15:45:09 +0000
commit250807797b9faaf6acfb083e2ef17d7fca879447 (patch)
tree31a2feec16994e9a97405adbceee111bf59d80b5 /gcc/tree-ssa-loop-niter.c
parent7290f0904907f37ad323a13d9426e07b449513dc (diff)
downloadgcc-250807797b9faaf6acfb083e2ef17d7fca879447.tar.gz
2008-03-16 Richard Guenther <rguenther@suse.de>
PR middle-end/35607 * tree-ssa-loop-niter.c (expand_simple_operations): Do not expand TREE_INVARIANT operations that are not gimple invariant. * gcc.c-torture/compile/pr35607.c: New testcase. * gcc.dg/tree-ssa/loop-19.c: Use -O2 to avoid vectorization. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133273 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 40e7051c265..0696342bd1b 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -1436,6 +1436,10 @@ expand_simple_operations (tree expr)
return expr;
e = GIMPLE_STMT_OPERAND (stmt, 1);
+ /* Do not expand random invariants. */
+ if (TREE_INVARIANT (e)
+ && !is_gimple_min_invariant (e))
+ return expr;
if (/* Casts are simple. */
TREE_CODE (e) != NOP_EXPR
&& TREE_CODE (e) != CONVERT_EXPR