[Bug tree-optimization/60899] undef reference generated with -fdevirtualize-speculatively

hubicka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Apr 20 07:23:00 GMT 2014


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

--- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
I am running benchmarks I do not want to disturb, but the following should fix
the problem.
$ svn diff ../../gcc/gimple-fold.c
Index: ../../gcc/gimple-fold.c
===================================================================
--- ../../gcc/gimple-fold.c     (revision 209526)
+++ ../../gcc/gimple-fold.c     (working copy)
@@ -105,7 +105,9 @@ can_refer_decl_in_current_unit_p (tree d
      external var.  */
   if (!from_decl
       || TREE_CODE (from_decl) != VAR_DECL
-      || !DECL_EXTERNAL (from_decl)
+      || (!DECL_EXTERNAL (from_decl)
+         && (vnode = varpool_get_node (from_decl)) != NULL
+         && vnode->definition)
       || (flag_ltrans
          && symtab_get_node (from_decl)->in_other_partition))
     return true;



More information about the Gcc-bugs mailing list