http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59947

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
--- gcc/ipa-devirt.c.jj    2014-01-13 08:54:29.000000000 +0100
+++ gcc/ipa-devirt.c    2014-01-31 18:04:01.869210678 +0100
@@ -1212,7 +1212,7 @@ devirt_variable_node_removal_hook (varpo
    temporarily change to one of base types.  INCLUDE_DERIVER_TYPES make
    us to walk the inheritance graph for all derivations.

-   If COMPLETEP is non-NULL, store true if the list is complette. 
+   If COMPLETEP is non-NULL, store true if the list is complete. 
    CACHE_TOKEN (if non-NULL) will get stored to an unique ID of entry
    in the target cache.  If user needs to visit every target list
    just once, it can memoize them.
@@ -1231,7 +1231,7 @@ possible_polymorphic_call_targets (tree
   static struct cgraph_node_hook_list *node_removal_hook_holder;
   pointer_set_t *inserted;
   pointer_set_t *matched_vtables;
-  vec <cgraph_node *> nodes=vNULL;
+  vec <cgraph_node *> nodes = vNULL;
   odr_type type, outer_type;
   polymorphic_call_target_d key;
   polymorphic_call_target_d **slot;
@@ -1239,6 +1239,13 @@ possible_polymorphic_call_targets (tree
   tree binfo, target;
   bool final;

+  if (!odr_hash.is_created ())
+    {
+      if (completep)
+    *completep = false;
+      return nodes;
+    }
+
   type = get_odr_type (otr_type, true);

   /* Lookup the outer class type we want to walk.  */

fixes this, but not sure if that is what Honza wants.  As odr_hash isn't
public, the other possibility would be just to export some function whether it
is ok to call possible_polymorphic_call_targets, that gimple_fold_call could
check.

Reply via email to