aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenth@gcc.gnu.org>2005-05-26 21:07:38 +0000
committerJeff Law <law@redhat.com>2005-05-26 21:07:38 +0000
commitcf1151a6bdd934d38ac249f5d75efb169f7d5fca (patch)
treef756e596fcc002b13c70d53236c7e41461b341c7 /gcc/tree-ssa-forwprop.c
parent870b8ac141320e873b743e1fee0efe6f428f22e2 (diff)
* tree-ssa-forwprop.c (forward_propagate_addr_expr):
See through ADDR_EXPR in finding place to propagate into. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@100223 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r--gcc/tree-ssa-forwprop.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 17da0f1228c..de85b7cf9c6 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -560,7 +560,8 @@ forward_propagate_addr_expr (tree stmt)
if (bb_for_stmt (use_stmt)->loop_depth > stmt_loop_depth)
return false;
- /* Strip away any outer COMPONENT_REF/ARRAY_REF nodes from the LHS. */
+ /* Strip away any outer COMPONENT_REF/ARRAY_REF nodes from the LHS.
+ ADDR_EXPR will not appear on the LHS. */
lhs = TREE_OPERAND (use_stmt, 0);
while (TREE_CODE (lhs) == COMPONENT_REF || TREE_CODE (lhs) == ARRAY_REF)
lhs = TREE_OPERAND (lhs, 0);
@@ -591,9 +592,12 @@ forward_propagate_addr_expr (tree stmt)
return true;
}
- /* Strip away any outer COMPONENT_REF/ARRAY_REF nodes from the RHS. */
+ /* Strip away any outer COMPONENT_REF, ARRAY_REF or ADDR_EXPR
+ nodes from the RHS. */
rhs = TREE_OPERAND (use_stmt, 1);
- while (TREE_CODE (rhs) == COMPONENT_REF || TREE_CODE (rhs) == ARRAY_REF)
+ while (TREE_CODE (rhs) == COMPONENT_REF
+ || TREE_CODE (rhs) == ARRAY_REF
+ || TREE_CODE (rhs) == ADDR_EXPR)
rhs = TREE_OPERAND (rhs, 0);
/* Now see if the RHS node is an INDIRECT_REF using NAME. If so,