http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60600
Martin Jambor <jamborm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jamborm at gcc dot
gnu.org
--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> ---
This is what I'm about to bootstrap and test and then try with Mozilla
Firefox.
It might be worthwhile to report the error in the library from which
the testcase is derived. You can even try and build and test the
library with this patch but with BUILT_IN_UNREACHABLE replaced with
BUILT_IN_ABORT to track the issue.
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -1639,11 +1639,18 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
return NULL_TREE;
target = gimple_get_virt_method_for_binfo (token, binfo);
}
-#ifdef ENABLE_CHECKING
- if (target)
- gcc_assert (possible_polymorphic_call_target_p
- (ie, cgraph_get_node (target)));
-#endif
+
+ if (target && !possible_polymorphic_call_target_p (ie,
+ cgraph_get_node (target)))
+ {
+ if (dump_file)
+ fprintf (dump_file,
+ "Type inconsident devirtualization: %s/%i->%s\n",
+ ie->caller->name (), ie->caller->order,
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (target)));
+ target = builtin_decl_implicit (BUILT_IN_UNREACHABLE);
+ cgraph_get_create_node (target);
+ }
return target;
}