summaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r--gcc/ipa-prop.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 24019655ad7..300b39b5627 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "data-streamer.h"
#include "tree-streamer.h"
#include "params.h"
+#include "ipa-utils.h"
/* Intermediate information about a parameter that is only useful during the
run of ipa_analyze_node and is not kept afterwards. */
@@ -247,8 +248,7 @@ ipa_print_node_jump_functions_for_edge (FILE *f, struct cgraph_edge *cs)
fprintf (f, "PASS THROUGH: ");
fprintf (f, "%d, op %s",
jump_func->value.pass_through.formal_id,
- tree_code_name[(int)
- jump_func->value.pass_through.operation]);
+ get_tree_code_name(jump_func->value.pass_through.operation));
if (jump_func->value.pass_through.operation != NOP_EXPR)
{
fprintf (f, " ");
@@ -2196,6 +2196,11 @@ ipa_intraprocedural_devirtualization (gimple call)
token = OBJ_TYPE_REF_TOKEN (otr);
fndecl = gimple_get_virt_method_for_binfo (tree_to_uhwi (token),
binfo);
+#ifdef ENABLE_CHECKING
+ if (fndecl)
+ gcc_assert (possible_polymorphic_call_target_p
+ (otr, cgraph_get_node (fndecl)));
+#endif
return fndecl;
}
@@ -2651,7 +2656,13 @@ try_make_edge_direct_virtual_call (struct cgraph_edge *ie,
return NULL;
if (target)
- return ipa_make_edge_direct_to_target (ie, target);
+ {
+#ifdef ENABLE_CHECKING
+ gcc_assert (possible_polymorphic_call_target_p
+ (ie, cgraph_get_node (target)));
+#endif
+ return ipa_make_edge_direct_to_target (ie, target);
+ }
else
return NULL;
}