aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2014-06-12 09:48:23 +0200
committerMartin Liska <marxin@gcc.gnu.org>2014-06-12 07:48:23 +0000
commit3c9e6fca817dab3861222e0c1bfbcf5c9c252830 (patch)
treed247a8931da5f75ccb0b0a962123272fea6c0259
parentf961457f887a965ecca2f35b81e33c077759c347 (diff)
downloadgcc-3c9e6fca817dab3861222e0c1bfbcf5c9c252830.zip
gcc-3c9e6fca817dab3861222e0c1bfbcf5c9c252830.tar.gz
gcc-3c9e6fca817dab3861222e0c1bfbcf5c9c252830.tar.bz2
re PR ipa/61462 (ICE in ipa-prop.c:2562 caused by missing edge gimple call stmt)
PR ipa/61462 * ipa-prop.c (ipa_make_edge_direct_to_target): Check that gimple call statement is reachable. From-SVN: r211490
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ipa-prop.c34
2 files changed, 30 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 04736b8..a8db34b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2014-06-12 Martin Liska <mliska@suse.cz>
+
+ PR ipa/61462
+ * ipa-prop.c (ipa_make_edge_direct_to_target): Check that gimple call
+ statement is reachable.
+
2014-06-11 Jan Hubicka <hubicka@ucw.cz>
* symtab.c (section_hash): New hash.
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index d02093a..b67deed 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -2673,13 +2673,19 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target)
if (dump_enabled_p ())
{
- location_t loc = gimple_location (ie->call_stmt);
- dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc,
- "discovered direct call to non-function in %s/%i, "
- "making it __builtin_unreachable\n",
- ie->caller->name (),
- ie->caller->order);
+ const char *fmt = "discovered direct call to non-function in %s/%i, "
+ "making it __builtin_unreachable\n";
+
+ if (ie->call_stmt)
+ {
+ location_t loc = gimple_location (ie->call_stmt);
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc, fmt,
+ ie->caller->name (), ie->caller->order);
+ }
+ else if (dump_file)
+ fprintf (dump_file, fmt, ie->caller->name (), ie->caller->order);
}
+
target = builtin_decl_implicit (BUILT_IN_UNREACHABLE);
callee = cgraph_get_create_node (target);
unreachable = true;
@@ -2739,10 +2745,18 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target)
}
if (dump_enabled_p ())
{
- location_t loc = gimple_location (ie->call_stmt);
- dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc,
- "converting indirect call in %s to direct call to %s\n",
- ie->caller->name (), callee->name ());
+ const char *fmt = "converting indirect call in %s to direct call to %s\n";
+
+ if (ie->call_stmt)
+ {
+ location_t loc = gimple_location (ie->call_stmt);
+
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc, fmt,
+ ie->caller->name (), callee->name ());
+
+ }
+ else if (dump_file)
+ fprintf (dump_file, fmt, ie->caller->name (), callee->name ());
}
ie = cgraph_make_edge_direct (ie, callee);
es = inline_edge_summary (ie);