https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69630

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #5)
> URL: https://gcc.gnu.org/viewcvs?rev=233711&root=gcc&view=rev
> Log:
>       PR ipa/69630
>       * ipa-devirt.c (possible_polymorphic_call_targets): Do not ICE
>       on builtin_unreachable.

This does not fix the problem of the test case of comment 1. The committed
patch (comment 5) has added:

@@ -3181,6 +3181,7 @@ possible_polymorphic_call_targets (tree otr_type,
                {
                  if (complete
                      && nodes.length () == 1
+                     && TREE_CODE (TREE_TYPE (nodes[0]->decl)) == METHOD_TYPE
                      && warn_suggest_final_types
                      && !outer_type->derived_types.length ())

Which doesn't prevent the ICE. The patch in comment 3 works - and has added the
following. (Cf. line numbers and last lines of the patches):

@@ -3197,6 +3198,7 @@
                  if (complete
                      && warn_suggest_final_methods
                      && nodes.length () == 1
+                     && TREE_CODE (TREE_TYPE (nodes[0]->decl)) == METHOD_TYPE
                      && types_same_for_odr (DECL_CONTEXT (nodes[0]->decl),
                                             outer_type->type))

Reply via email to