diff options
Diffstat (limited to 'gcc/tree-ssa-loop-ivcanon.c')
-rw-r--r-- | gcc/tree-ssa-loop-ivcanon.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c index 2ced3070d48..187f53c7a66 100644 --- a/gcc/tree-ssa-loop-ivcanon.c +++ b/gcc/tree-ssa-loop-ivcanon.c @@ -162,10 +162,8 @@ constant_after_peeling (tree op, gimple stmt, struct loop *loop) /* First make fast look if we see constant array inside. */ while (handled_component_p (base)) base = TREE_OPERAND (base, 0); - if ((DECL_P (base) - && TREE_STATIC (base) - && TREE_READONLY (base) - && varpool_get_node (base)->const_value_known) + if ((DECL_P (base) == VAR_DECL + && const_value_known_p (base)) || CONSTANT_CLASS_P (base)) { /* If so, see if we understand all the indices. */ |