summaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-15 10:39:28 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-15 10:39:28 +0000
commit95fb32034e3e00670e6abc0cc930b3fd8aacc47b (patch)
tree6b4472d8eb1289a2e5d764132d9e64216728b539 /gcc/ipa-prop.c
parent15c999e300ce4b964596356967085d8e5f21cb4f (diff)
downloadgcc-95fb32034e3e00670e6abc0cc930b3fd8aacc47b.tar.gz
2013-05-15 Martin Jambor <mjambor@suse.cz>
* ipa-prop.c (ipa_make_edge_direct_to_target): Redirect calls to non-functions to builtin_unreachable. * ipa-inline-transform.c (inline_call): Do not assert estimates were correct when new direct edges were discovered. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198926 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r--gcc/ipa-prop.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 9ae3d69b74b..abf21c98215 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -2200,6 +2200,7 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target)
{
struct cgraph_node *callee;
struct inline_edge_summary *es = inline_edge_summary (ie);
+ bool unreachable = false;
if (TREE_CODE (target) == ADDR_EXPR)
target = TREE_OPERAND (target, 0);
@@ -2210,12 +2211,17 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target)
{
if (dump_file)
fprintf (dump_file, "ipa-prop: Discovered direct call to non-function"
- " in %s/%i.\n",
+ " in %s/%i, making it unreachable.\n",
cgraph_node_name (ie->caller), ie->caller->symbol.order);
- return NULL;
+ target = builtin_decl_implicit (BUILT_IN_UNREACHABLE);
+ callee = cgraph_get_create_node (target);
+ unreachable = true;
}
+ else
+ callee = cgraph_get_node (target);
}
- callee = cgraph_get_node (target);
+ else
+ callee = cgraph_get_node (target);
/* Because may-edges are not explicitely represented and vtable may be external,
we may create the first reference to the object in the unit. */
@@ -2252,7 +2258,7 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target)
- eni_size_weights.call_cost);
es->call_stmt_time -= (eni_time_weights.indirect_call_cost
- eni_time_weights.call_cost);
- if (dump_file)
+ if (dump_file && !unreachable)
{
fprintf (dump_file, "ipa-prop: Discovered %s call to a known target "
"(%s/%i -> %s/%i), for stmt ",