aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraph.cc')
-rw-r--r--gcc/cgraph.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc
index 94a2e6e..32071a8 100644
--- a/gcc/cgraph.cc
+++ b/gcc/cgraph.cc
@@ -1790,6 +1790,19 @@ cgraph_update_edges_for_call_stmt_node (cgraph_node *node,
if (e)
{
+ /* If call was devirtualized during cloning, mark edge
+ as resolved. */
+ if (e->speculative)
+ {
+ if (new_stmt && is_gimple_call (new_stmt))
+ {
+ tree decl = gimple_call_fndecl (new_stmt);
+ if (decl)
+ e = cgraph_edge::resolve_speculation (e, decl);
+ }
+ else
+ e = cgraph_edge::resolve_speculation (e, NULL);
+ }
/* Keep calls marked as dead dead. */
if (new_stmt && is_gimple_call (new_stmt) && e->callee
&& fndecl_built_in_p (e->callee->decl, BUILT_IN_UNREACHABLE,