aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-cp.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2013-04-19 14:00:27 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2013-04-19 14:00:27 +0200
commite248d83f4ba23139d1c24aac2d9b2caf9c67c206 (patch)
tree48a1cde54c03eeceeb5712488b900a74b29947ac /gcc/ipa-cp.c
parent4891e8f8cdeb34ad392a8cf374ce9b8ee54a177f (diff)
downloadgcc-e248d83f4ba23139d1c24aac2d9b2caf9c67c206.zip
gcc-e248d83f4ba23139d1c24aac2d9b2caf9c67c206.tar.gz
gcc-e248d83f4ba23139d1c24aac2d9b2caf9c67c206.tar.bz2
re PR tree-optimization/56718 (Early inlining prevents type based devirtualization)
2013-04-19 Martin Jambor <mjambor@suse.cz> PR tree-optimization/56718 * ipa-cp.c (ipa_value_from_known_type_jfunc): Moved... * ipa-prop.c (ipa_binfo_from_known_type_jfunc): ...here, renamed and made public. Adjusted all callers. (ipa_intraprocedural_devirtualization): New function. * ipa-prop.h (ipa_binfo_from_known_type_jfunc): Declare. (ipa_intraprocedural_devirtualization): Likewise. * Makefile.in (tree-ssa-pre.o): Add ipa-prop.h to dependencies. testsuite/ * g++.dg/ipa/imm-devirt-1.C: New test. * g++.dg/ipa/imm-devirt-2.C: Likewise. From-SVN: r198088
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r--gcc/ipa-cp.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 27aed3c..48521cf 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -791,20 +791,6 @@ ipa_get_jf_ancestor_result (struct ipa_jump_func *jfunc, tree input)
return NULL_TREE;
}
-/* Extract the acual BINFO being described by JFUNC which must be a known type
- jump function. */
-
-static tree
-ipa_value_from_known_type_jfunc (struct ipa_jump_func *jfunc)
-{
- tree base_binfo = TYPE_BINFO (ipa_get_jf_known_type_base_type (jfunc));
- if (!base_binfo)
- return NULL_TREE;
- return get_binfo_at_offset (base_binfo,
- ipa_get_jf_known_type_offset (jfunc),
- ipa_get_jf_known_type_component_type (jfunc));
-}
-
/* Determine whether JFUNC evaluates to a known value (that is either a
constant or a binfo) and if so, return it. Otherwise return NULL. INFO
describes the caller node so that pass-through jump functions can be
@@ -816,7 +802,7 @@ ipa_value_from_jfunc (struct ipa_node_params *info, struct ipa_jump_func *jfunc)
if (jfunc->type == IPA_JF_CONST)
return ipa_get_jf_constant (jfunc);
else if (jfunc->type == IPA_JF_KNOWN_TYPE)
- return ipa_value_from_known_type_jfunc (jfunc);
+ return ipa_binfo_from_known_type_jfunc (jfunc);
else if (jfunc->type == IPA_JF_PASS_THROUGH
|| jfunc->type == IPA_JF_ANCESTOR)
{
@@ -1103,7 +1089,7 @@ propagate_scalar_accross_jump_function (struct cgraph_edge *cs,
if (jfunc->type == IPA_JF_KNOWN_TYPE)
{
- val = ipa_value_from_known_type_jfunc (jfunc);
+ val = ipa_binfo_from_known_type_jfunc (jfunc);
if (!val)
return set_lattice_contains_variable (dest_lat);
}