summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-analysis.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-28 23:59:31 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-28 23:59:31 +0000
commit1822e6f23e7ba4838f4e9535d19eea03ee3e2bc1 (patch)
tree5b3e66ce7c0bea0c2a3a738891cf18d64021e498 /gcc/ipa-inline-analysis.c
parent74ee6ab5823cdaf2c05483ecc8b4f5fee0137647 (diff)
downloadgcc-1822e6f23e7ba4838f4e9535d19eea03ee3e2bc1.tar.gz
* ipa-inline-analysis.c (eliminated_by_inlining_prob): Handle
&this->field expressions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192899 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline-analysis.c')
-rw-r--r--gcc/ipa-inline-analysis.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 3b56e7ae0a0..a8d16a8c8c6 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -1567,6 +1567,7 @@ eliminated_by_inlining_prob (gimple stmt)
if (gimple_assign_rhs_code (stmt) == CONVERT_EXPR
|| gimple_assign_rhs_code (stmt) == NOP_EXPR
|| gimple_assign_rhs_code (stmt) == VIEW_CONVERT_EXPR
+ || gimple_assign_rhs_code (stmt) == ADDR_EXPR
|| gimple_assign_rhs_class (stmt) == GIMPLE_SINGLE_RHS)
{
tree rhs = gimple_assign_rhs1 (stmt);
@@ -1584,6 +1585,20 @@ eliminated_by_inlining_prob (gimple stmt)
/* Reads of parameter are expected to be free. */
if (unmodified_parm (stmt, inner_rhs))
rhs_free = true;
+ /* Match expressions of form &this->field. Those will most likely
+ combine with something upstream after inlining. */
+ else if (TREE_CODE (inner_rhs) == ADDR_EXPR)
+ {
+ tree op = get_base_address (TREE_OPERAND (inner_rhs, 0));
+ if (TREE_CODE (op) == PARM_DECL)
+ rhs_free = true;
+ else if (TREE_CODE (op) == MEM_REF)
+ {
+ op = get_base_address (TREE_OPERAND (op, 0));
+ if (unmodified_parm (stmt, op))
+ rhs_free = true;
+ }
+ }
/* When parameter is not SSA register because its address is taken
and it is just copied into one, the statement will be completely