is_gimple_addressable (tree t)
{
return (is_gimple_id (t) || handled_component_p (t)
- || TREE_CODE (t) == REALPART_EXPR
- || TREE_CODE (t) == IMAGPART_EXPR
|| INDIRECT_REF_P (t));
-
}
/* Return true if T is function invariant. Or rather a restricted
return NULL_TREE;
}
-/* Given a memory reference expression, return the base address. Note that,
- in contrast with get_base_var, this will not recurse inside INDIRECT_REF
- expressions. Therefore, given the reference PTR->FIELD, this function
- will return *PTR. Whereas get_base_var would've returned PTR. */
+/* Given a memory reference expression T, return its base address.
+ The base address of a memory reference expression is the main
+ object being referenced. For instance, the base address for
+ 'array[i].fld[j]' is 'array'. You can think of this as stripping
+ away the offset part from a memory address.
+
+ This function calls handled_component_p to strip away all the inner
+ parts of the memory reference until it reaches the base object. */
tree
get_base_address (tree t)
{
- while (TREE_CODE (t) == REALPART_EXPR || TREE_CODE (t) == IMAGPART_EXPR
- || handled_component_p (t))
+ while (handled_component_p (t))
t = TREE_OPERAND (t, 0);
if (SSA_VAR_P (t)
recalculate_side_effects (tree t)
{
enum tree_code code = TREE_CODE (t);
- int fro = first_rtl_op (code);
+ int len = TREE_CODE_LENGTH (code);
int i;
switch (TREE_CODE_CLASS (code))
case tcc_binary: /* a binary arithmetic expression */
case tcc_reference: /* a reference */
TREE_SIDE_EFFECTS (t) = TREE_THIS_VOLATILE (t);
- for (i = 0; i < fro; ++i)
+ for (i = 0; i < len; ++i)
{
tree op = TREE_OPERAND (t, i);
if (op && TREE_SIDE_EFFECTS (op))