summaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authordavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>2014-05-20 20:12:22 +0000
committerdavidxl <davidxl@138bc75d-0d04-0410-961f-82ee72b054a4>2014-05-20 20:12:22 +0000
commitceb49bba2f3f50e532649f3632904e78a26cffb3 (patch)
tree01587269ffd956843f503c973e2d46f9e33e8016 /gcc/ipa.c
parent8c4f44859bce9b2cb5d5a008d53b3d42f9c6a042 (diff)
downloadgcc-ceb49bba2f3f50e532649f3632904e78a26cffb3.tar.gz
add dbgcnt support for devirt
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210657 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 9c88fe4dbba..a4e9b227330 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -37,6 +37,10 @@ along with GCC; see the file COPYING3. If not see
#include "tree-inline.h"
#include "profile.h"
#include "params.h"
+#include "internal-fn.h"
+#include "tree-ssa-alias.h"
+#include "gimple.h"
+#include "dbgcnt.h"
/* Return true when NODE can not be local. Worker for cgraph_local_node_p. */
@@ -213,7 +217,7 @@ walk_polymorphic_call_targets (pointer_set_t *reachable_call_targets,
make the edge direct. */
if (final)
{
- if (targets.length () <= 1)
+ if (targets.length () <= 1 && dbg_cnt (devirt))
{
cgraph_node *target, *node = edge->caller;
if (targets.length () == 1)
@@ -222,12 +226,15 @@ walk_polymorphic_call_targets (pointer_set_t *reachable_call_targets,
target = cgraph_get_create_node
(builtin_decl_implicit (BUILT_IN_UNREACHABLE));
- if (dump_file)
- fprintf (dump_file,
- "Devirtualizing call in %s/%i to %s/%i\n",
- edge->caller->name (),
- edge->caller->order,
- target->name (), target->order);
+ if (dump_enabled_p ())
+ {
+ location_t locus = gimple_location (edge->call_stmt);
+ dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, locus,
+ "devirtualizing call in %s/%i to %s/%i\n",
+ edge->caller->name (), edge->caller->order,
+ target->name (),
+ target->order);
+ }
edge = cgraph_make_edge_direct (edge, target);
if (inline_summary_vec)
inline_update_overall_summary (node);