This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR14841 and PR15838
On Tue, 2004-08-31 at 12:30, Giovanni Bajo wrote:
> Diego Novillo wrote:
>
> > On Tue, 2004-08-31 at 12:10, Steven Bosscher wrote:
> >
> >> ! else if (((TREE_CODE (rhs) == ARRAY_REF
> >> ! && TREE_CODE (var = TREE_OPERAND (rhs, 0)) == VAR_DECL
> >> ! && TREE_CODE (TREE_TYPE (var)) == ARRAY_TYPE)
> >> ! || (TREE_CODE (rhs) == COMPONENT_REF
> >> ! && TREE_CODE (var = TREE_OPERAND (rhs, 0)) == VAR_DECL
> >> ! && TREE_CODE (TREE_TYPE (var)) == RECORD_TYPE
> >> ! && TREE_CODE (TREE_OPERAND (rhs, 1)) == FIELD_DECL))
> >> ! && TREE_READONLY (var)
> >> ! && DECL_INITIAL (var)
> >> ! && TREE_CODE (DECL_INITIAL (var)) == CONSTRUCTOR
> >> ! && ! TREE_SIDE_EFFECTS (DECL_INITIAL (var)))
> >>
> > Put all this inside a static bool predicate, please.
>
> What about moving them inside try_extract_*, separating the two cases?
>
I meant something like this:
else
{
tree var, rhs = get_rhs (stmt);
if (likelyvalue == VARYING)
simplified = rhs;
else if (is_load_from_const_array (rhs))
simplified = extract_const_array_ref (rhs);
else if (is_load_from_const_component_ref (rhs))
simplified = extract_const_component_ref (rhs);
else
simplified = NULL_TREE;
}
Diego.
> Giovanni Bajo
>