This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: About the is_gimple_min_invariant predicate
> Passes ought to distinguish GIMPLE values from GIMPLE invariants
> according to context.
Looks like someone already ran into the problem. In tree-ssa-ccp.c:
/* 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;
}
--
Eric Botcazou