2004-06-25 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+ * tree-dfa.c (get_virtual_var): Merge real/imaginary parts with
+ handled_component_p handling.
+ * tree-gimple.c (get_base_address): Likewise and fix typo that
+ caused both recursion and looping.
+
* tree-cfg.c (verify_expr): Add macro CHECK_OK.
Properly test for nest of handled_components in LHS context.
if (TREE_CODE (var) == SSA_NAME)
var = SSA_NAME_VAR (var);
- if (TREE_CODE (var) == REALPART_EXPR || TREE_CODE (var) == IMAGPART_EXPR)
+ while (TREE_CODE (var) == REALPART_EXPR || TREE_CODE (var) == IMAGPART_EXPR
+ || handled_component_p (var))
var = TREE_OPERAND (var, 0);
- else
- while (handled_component_p (var))
- var = TREE_OPERAND (var, 0);
#ifdef ENABLE_CHECKING
/* Treating GIMPLE registers as virtual variables makes no sense.
tree
get_base_address (tree t)
{
- do
- {
- if (SSA_VAR_P (t)
- || TREE_CODE (t) == STRING_CST
- || TREE_CODE (t) == CONSTRUCTOR
- || TREE_CODE (t) == INDIRECT_REF)
- return t;
-
- if (TREE_CODE (t) == REALPART_EXPR || TREE_CODE (t) == IMAGPART_EXPR)
- t = TREE_OPERAND (t, 0);
- else if (handled_component_p (t))
- t = get_base_address (TREE_OPERAND (t, 0));
- else
- return NULL_TREE;
- }
- while (t);
-
- return t;
+ while (TREE_CODE (t) == REALPART_EXPR || TREE_CODE (t) == IMAGPART_EXPR
+ || handled_component_p (t))
+ t = TREE_OPERAND (t, 0);
+
+ if (SSA_VAR_P (t)
+ || TREE_CODE (t) == STRING_CST
+ || TREE_CODE (t) == CONSTRUCTOR
+ || TREE_CODE (t) == INDIRECT_REF)
+ return t;
+ else
+ return NULL_TREE;
}
-
void
recalculate_side_effects (tree t)
{