From: Richard Kenner Date: Fri, 25 Jun 2004 18:30:09 +0000 (+0000) Subject: tree-dfa.c (get_virtual_var): Merge real/imaginary parts with handled_component_p... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=75822272d9f74ec95289fe8dd74944c383c14348;p=gcc.git tree-dfa.c (get_virtual_var): Merge real/imaginary parts with handled_component_p handling. * 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. From-SVN: r83669 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7ac68fc7300..93329f92785 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -6,6 +6,11 @@ 2004-06-25 Richard Kenner + * 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. diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 2778d53a8b3..99f998f9c1d 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -922,11 +922,9 @@ get_virtual_var (tree var) 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. diff --git a/gcc/tree-gimple.c b/gcc/tree-gimple.c index 36e4393d2b3..b1f08dfee4a 100644 --- a/gcc/tree-gimple.c +++ b/gcc/tree-gimple.c @@ -602,27 +602,19 @@ rationalize_compound_expr (tree top) 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) {