summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-analysis.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-21 13:10:31 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2011-09-21 13:10:31 +0000
commit6b4a202b908827b6d7b3733de4a6e837f20485e4 (patch)
tree533bacc29cc3834c0fb7e1cc1f40da732fb9d038 /gcc/ipa-inline-analysis.c
parent23d77b6df4d72037852fc2f36d5982b836b5fb0e (diff)
downloadgcc-6b4a202b908827b6d7b3733de4a6e837f20485e4.tar.gz
PR tree-optimization/50433
* ipa-inline-analysis.c (eliminated_by_inlining_prob): Use get_base_address. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179046 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r--gcc/ipa-inline-analysis.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 6bc96c7788e..fc954b3d101 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -1149,18 +1149,15 @@ eliminated_by_inlining_prob (gimple stmt)
{
tree rhs = gimple_assign_rhs1 (stmt);
tree lhs = gimple_assign_lhs (stmt);
- tree inner_rhs = rhs;
- tree inner_lhs = lhs;
+ tree inner_rhs = get_base_address (rhs);
+ tree inner_lhs = get_base_address (lhs);
bool rhs_free = false;
bool lhs_free = false;
- while (handled_component_p (inner_lhs)
- || TREE_CODE (inner_lhs) == MEM_REF)
- inner_lhs = TREE_OPERAND (inner_lhs, 0);
- while (handled_component_p (inner_rhs)
- || TREE_CODE (inner_rhs) == ADDR_EXPR
- || TREE_CODE (inner_rhs) == MEM_REF)
- inner_rhs = TREE_OPERAND (inner_rhs, 0);
+ if (!inner_rhs)
+ inner_rhs = rhs;
+ if (!inner_lhs)
+ inner_lhs = lhs;
if (unmodified_parm (stmt, inner_rhs))
rhs_free = true;