aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-09-08 18:42:21 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-09-08 16:42:21 +0000
commit3462aa02a699dc716bd366fee8fc1c85f7f94541 (patch)
tree6aaf6ed20bc90f69bf381f4674ecd79f8abee69c /gcc/cgraphunit.c
parent26e5b0fd2818c746fcd016bd1b6fa434204a5d72 (diff)
downloadgcc-3462aa02a699dc716bd366fee8fc1c85f7f94541.zip
gcc-3462aa02a699dc716bd366fee8fc1c85f7f94541.tar.gz
gcc-3462aa02a699dc716bd366fee8fc1c85f7f94541.tar.bz2
devirt-11.C: Update template.
* testsuite/g++.dg/ipa/devirt-11.C: Update template. * testsuite/g++.dg/ipa/devirt-16.C: New testcase. * testsuite/g++.dg/ipa/devirt-17.C: New testcase. * testsuite/g++.dg/ipa/devirt-18.C: New testcase. * cgraphunit.c (walk_polymorphic_call_targets): Permit 0 possible targets and devirtualize to BUILT_IN_UNREACHABLE. * timevar.def (TV_IPA_UNREACHABLE): New timevar. * ipa.c (walk_polymorphic_call_targets): New function. (symtab_remove_unreachable_nodes): Use it; do not keep all virtual functions; use the new timevar. * ipa-devirt.c (maybe_record_node): Do not insert static nodes that was removed from the program. (record_binfo): If BINFO corresponds to an anonymous namespace, we may not consider it in the walk when its vtable is dead. (possible_polymorphic_call_targets_1): Pass anonymous flag to record_binfo. (devirt_variable_node_removal_hook): New function. (possible_polymorphic_call_targets): Also register devirt_variable_node_removal_hook. (ipa_devirt): Do not do non-speculative devirtualization. (gate_ipa_devirt): One execute if devirtualizing speculatively. From-SVN: r202368
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 1afdd43..9681df5 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -866,9 +866,15 @@ walk_polymorphic_call_targets (pointer_set_t *reachable_call_targets,
make the edge direct. */
if (final)
{
- gcc_assert (targets.length());
- if (targets.length() == 1)
+ if (targets.length() <= 1)
{
+ cgraph_node *target;
+ if (targets.length () == 1)
+ target = targets[0];
+ else
+ target = cgraph_get_create_node
+ (builtin_decl_implicit (BUILT_IN_UNREACHABLE));
+
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file,
@@ -877,7 +883,7 @@ walk_polymorphic_call_targets (pointer_set_t *reachable_call_targets,
edge->call_stmt, 0,
TDF_SLIM);
}
- cgraph_make_edge_direct (edge, targets[0]);
+ cgraph_make_edge_direct (edge, target);
cgraph_redirect_edge_call_stmt_to_callee (edge);
if (cgraph_dump_file)
{
@@ -1092,7 +1098,7 @@ analyze_functions (void)
mangling and same body alias creation before we free DECL_ARGUMENTS
used by it. */
if (!seen_error ())
- symtab_initialize_asm_name_hash ();
+ symtab_initialize_asm_name_hash ();
}
/* Translate the ugly representation of aliases as alias pairs into nice