}
-/* The regular is_gimple_min_invariant does a shallow test of the object.
- It assumes that full gimplification has happened, or will happen on the
- object. For a value coming from DECL_INITIAL, this is not true, so we
- have to be more strict ourselves. */
-
-static bool
-ccp_decl_initial_min_invariant (tree t)
-{
- if (!is_gimple_min_invariant (t))
- return false;
- if (TREE_CODE (t) == ADDR_EXPR)
- {
- /* Inline and unroll is_gimple_addressable. */
- while (1)
- {
- t = TREE_OPERAND (t, 0);
- if (is_gimple_id (t))
- return true;
- if (!handled_component_p (t))
- return false;
- }
- }
- return true;
-}
-
/* If SYM is a constant variable with known value, return the value.
NULL_TREE is returned otherwise. */
{
tree val = DECL_INITIAL (sym);
if (val
- && ccp_decl_initial_min_invariant (val))
+ && is_gimple_min_invariant (val))
return val;
/* Variables declared 'const' without an initializer
have zero as the intializer if they may not be
/* Fold away CONST_DECL to its value, if the type is scalar. */
if (TREE_CODE (base) == CONST_DECL
- && ccp_decl_initial_min_invariant (DECL_INITIAL (base)))
+ && is_gimple_min_invariant (DECL_INITIAL (base)))
return DECL_INITIAL (base);
/* Try folding *(&B+O) to B.X. */