diff options
author | Andrew Pinski <andrew_pinski@playstation.sony.com> | 2007-03-19 13:36:29 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-03-19 13:36:29 +0000 |
commit | 60e0af94184fd0ca0a9de35f8abe31f22537b655 (patch) | |
tree | 5d5924d36ea276f32b54a6e14048922b48868cfd /gcc/tree-ssa-forwprop.c | |
parent | 3d16fe64c5be0a0ff96b98e78008441b8ab5b35c (diff) | |
download | gcc-60e0af94184fd0ca0a9de35f8abe31f22537b655.zip gcc-60e0af94184fd0ca0a9de35f8abe31f22537b655.tar.gz gcc-60e0af94184fd0ca0a9de35f8abe31f22537b655.tar.bz2 |
re PR tree-optimization/31254 (verify_ssa failed: type mismatch between an SSA_NAME and its symbol)
2007-03-19 Andrew Pinski <andrew_pinski@playstation.sony.com>
Richard Guenther <rguenther@suse.de>
PR tree-optimization/31254
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1):
Use handled_component_p () where appropriate. Continue
propagating into the rhs if we propagated into an INDIRECT_REF
on the lhs.
* gcc.dg/torture/pr31254.c: New testcase.
Co-Authored-By: Richard Guenther <rguenther@suse.de>
From-SVN: r123060
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r-- | gcc/tree-ssa-forwprop.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index a755a4a..95a0c91 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -680,7 +680,7 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt) /* Strip away any outer COMPONENT_REF/ARRAY_REF nodes from the LHS. ADDR_EXPR will not appear on the LHS. */ lhs = GIMPLE_STMT_OPERAND (use_stmt, 0); - while (TREE_CODE (lhs) == COMPONENT_REF || TREE_CODE (lhs) == ARRAY_REF) + while (handled_component_p (lhs)) lhs = TREE_OPERAND (lhs, 0); rhs = GIMPLE_STMT_OPERAND (use_stmt, 1); @@ -695,9 +695,7 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt) fold_stmt_inplace (use_stmt); tidy_after_forward_propagate_addr (use_stmt); - /* The only case we did not replace all uses this way is if the - use statement is of the form *name = name. */ - return rhs != name; + /* Continue propagating into the RHS. */ } /* Trivial case. The use statement could be a trivial copy or a @@ -714,8 +712,7 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt) /* Strip away any outer COMPONENT_REF, ARRAY_REF or ADDR_EXPR nodes from the RHS. */ - while (TREE_CODE (rhs) == COMPONENT_REF - || TREE_CODE (rhs) == ARRAY_REF + while (handled_component_p (rhs) || TREE_CODE (rhs) == ADDR_EXPR) rhs = TREE_OPERAND (rhs, 0); |