summaryrefslogtreecommitdiff
path: root/gcc/ipa-icf-gimple.c
diff options
context:
space:
mode:
authormarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-14 10:35:13 +0000
committermarxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-14 10:35:13 +0000
commitcadb17daec6ac57c49e1fe596f770c02f1abdba6 (patch)
tree9f702d94b0a0ab657939adb1fa1b6c7431d3b8d2 /gcc/ipa-icf-gimple.c
parent3a487db5ceb67f9eb5568696a6d247e9061078d4 (diff)
downloadgcc-cadb17daec6ac57c49e1fe596f770c02f1abdba6.tar.gz
IPA ICF: handle IMAGPART_EXPR and REALPART_EXPR.
* gcc.dg/ipa/pr64307.c: New test. * ipa-icf-gimple.c (func_checker::compare_operand): Add support for IMAGPART_EXPR and REALPART_EXPR and fix BIT_FIELD_REF comparison. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219586 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-icf-gimple.c')
-rw-r--r--gcc/ipa-icf-gimple.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c
index ed3cdf56ccb..05c2a23bd6f 100644
--- a/gcc/ipa-icf-gimple.c
+++ b/gcc/ipa-icf-gimple.c
@@ -448,6 +448,8 @@ func_checker::compare_operand (tree t1, tree t2)
return return_with_debug (ret);
}
+ case IMAGPART_EXPR:
+ case REALPART_EXPR:
case ADDR_EXPR:
{
x1 = TREE_OPERAND (t1, 0);
@@ -458,7 +460,17 @@ func_checker::compare_operand (tree t1, tree t2)
}
case BIT_FIELD_REF:
{
- ret = compare_decl (t1, t2);
+ x1 = TREE_OPERAND (t1, 0);
+ x2 = TREE_OPERAND (t2, 0);
+ y1 = TREE_OPERAND (t1, 1);
+ y2 = TREE_OPERAND (t2, 1);
+ z1 = TREE_OPERAND (t1, 2);
+ z2 = TREE_OPERAND (t2, 2);
+
+ ret = compare_operand (x1, x2)
+ && compare_cst_or_decl (y1, y2)
+ && compare_cst_or_decl (z1, z2);
+
return return_with_debug (ret);
}
case SSA_NAME: