* gimplify.c (is_gimple_addr_expr_arg_or_indirect): Remove.
(gimplify_modify_expr, gimplify_addr_expr, gimplify_expr): Use
is_gimple_addressable.
* tree-gimple.c (is_gimple_addressable): Rename from
is_gimple_addr_expr_arg; accept INDIRECT_REF.
(is_gimple_lvalue): Don't test INDIRECT_REF directly.
* tree-gimple.h, tree-sra.c, tree-ssa-loop-im.c: Update for
rename to is_gimple_addressable.
From-SVN: r85243
+2004-07-27 Richard Henderson <rth@redhat.com>
+
+ * gimplify.c (is_gimple_addr_expr_arg_or_indirect): Remove.
+ (gimplify_modify_expr, gimplify_addr_expr, gimplify_expr): Use
+ is_gimple_addressable.
+ * tree-gimple.c (is_gimple_addressable): Rename from
+ is_gimple_addr_expr_arg; accept INDIRECT_REF.
+ (is_gimple_lvalue): Don't test INDIRECT_REF directly.
+ * tree-gimple.h, tree-sra.c, tree-ssa-loop-im.c: Update for
+ rename to is_gimple_addressable.
+
2004-07-28 Alan Modra <amodra@bigpond.net.au>
* config/rs6000/rs6000.c (function_arg_padding): Pad SFmode upwards.
return ret;
}
-/* Return true if T is either a valid GIMPLE operand or is an
- INDIRECT_REF (the latter is valid since we'll strip it off). */
-
-static bool
-is_gimple_addr_expr_arg_or_indirect (tree t)
-{
- return (TREE_CODE (t) == INDIRECT_REF || is_gimple_addr_expr_arg (t));
-}
-
/* Gimplify the MODIFY_EXPR node pointed by EXPR_P.
modify_expr
if (TREE_CODE (from) == CONSTRUCTOR)
return gimplify_modify_expr_to_memset (expr_p, size, want_value);
- if (is_gimple_addr_expr_arg (from))
+ if (is_gimple_addressable (from))
{
*from_p = from;
return gimplify_modify_expr_to_memcpy (expr_p, size, want_value);
/* We use fb_either here because the C frontend sometimes takes
the address of a call that returns a struct. */
ret = gimplify_expr (&TREE_OPERAND (expr, 0), pre_p, post_p,
- is_gimple_addr_expr_arg_or_indirect, fb_either);
+ is_gimple_addressable, fb_either);
if (ret != GS_ERROR)
{
/* The above may have made an INDIRECT ref (e.g, Ada's NULL_EXPR),
postqueue; we need to copy the value out first, which means an
rvalue. */
if ((fallback & fb_lvalue) && !internal_post
- && is_gimple_addr_expr_arg (*expr_p))
+ && is_gimple_addressable (*expr_p))
{
/* An lvalue will do. Take the address of the expression, store it
in a temporary, and replace the expression with an INDIRECT_REF of
addr-expr-arg: ID
| compref
- with-size-arg: addr-expr-arg
+ addressable : addr-expr-arg
| indirectref
+
+ with-size-arg: addressable
| call-stmt
indirectref : INDIRECT_REF
op0 -> val
- lhs : addr-expr-arg
+ lhs : addressable
| bitfieldref
- | indirectref
| WITH_SIZE_EXPR
op0 -> with-size-arg
op1 -> val
bool
is_gimple_lvalue (tree t)
{
- return (is_gimple_addr_expr_arg (t)
- || TREE_CODE (t) == INDIRECT_REF
+ return (is_gimple_addressable (t)
|| TREE_CODE (t) == WITH_SIZE_EXPR
/* These are complex lvalues, but don't have addresses, so they
go here. */
|| TREE_CODE_CLASS (TREE_CODE (t)) == '<');
}
-/* Return true if T is a valid operand for ADDR_EXPR. */
+/* Return true if T is something whose address can be taken. */
bool
-is_gimple_addr_expr_arg (tree t)
+is_gimple_addressable (tree t)
{
return (is_gimple_id (t) || handled_component_p (t)
- || TREE_CODE (t) == REALPART_EXPR || TREE_CODE (t) == IMAGPART_EXPR);
+ || TREE_CODE (t) == REALPART_EXPR
+ || TREE_CODE (t) == IMAGPART_EXPR
+ || TREE_CODE (t) == INDIRECT_REF);
}
/* Return true if T is function invariant. Or rather a restricted
extern bool is_gimple_variable (tree);
/* Returns true iff T is a variable or an INDIRECT_REF (of a variable). */
extern bool is_gimple_min_lval (tree);
-/* Returns true iff T is an lvalue other than an INDIRECT_REF. */
-extern bool is_gimple_addr_expr_arg (tree);
+/* Returns true iff T is something whose address can be taken. */
+extern bool is_gimple_addressable (tree);
/* Returns true iff T is any valid GIMPLE lvalue. */
extern bool is_gimple_lvalue (tree);
The lvalue requirement prevents us from trying to directly scalarize
the result of a function call. Which would result in trying to call
the function multiple times, and other evil things. */
- else if (!lhs_elt->is_scalar && is_gimple_addr_expr_arg (rhs))
+ else if (!lhs_elt->is_scalar && is_gimple_addressable (rhs))
fns->ldst (lhs_elt, rhs, bsi, true);
/* Otherwise we're being used in some context that requires the
/* Hoisting memory references out should almost surely be a win. */
if (!is_gimple_variable (lhs))
cost += 20;
- if (is_gimple_addr_expr_arg (rhs) && !is_gimple_variable (rhs))
+ if (is_gimple_addressable (rhs) && !is_gimple_variable (rhs))
cost += 20;
switch (TREE_CODE (rhs))