This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52582] [4.7/4.8 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 14 Mar 2012 10:41:29 +0000
- Subject: [Bug c++/52582] [4.7/4.8 Regression] g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit)
- Auto-submitted: auto-generated
- References: <bug-52582-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52582
--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-14 10:41:29 UTC ---
Does
Index: gcc/gimple-fold.c
===================================================================
--- gcc/gimple-fold.c (revision 185376)
+++ gcc/gimple-fold.c (working copy)
@@ -143,6 +143,8 @@ canonicalize_constructor_val (tree cval)
if (cfun && gimple_referenced_vars (cfun))
add_referenced_var (base);
}
+ else if (base && TREE_CODE (base) == FUNCTION_DECL)
+ cgraph_get_create_node (base);
/* Fixup types in global initializers. */
if (TREE_TYPE (TREE_TYPE (cval)) != TREE_TYPE (TREE_OPERAND (cval, 0)))
cval = build_fold_addr_expr (TREE_OPERAND (cval, 0));
@@ -3115,6 +3117,11 @@ gimple_get_virt_method_for_binfo (HOST_W
if (!can_refer_decl_in_current_unit_p (fn))
return NULL_TREE;
+ /* Make sure we create a cgraph node for functions we'll reference.
+ They can be non-existent if the reference comes from an entry
+ of an external vtable for example. */
+ cgraph_get_create_node (fn);
+
return fn;
}
help?