This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/11421] [3.4 regression] vtables are not emitted in unit-at-a-time mode
- From: "jh at suse dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jul 2003 16:57:24 -0000
- Subject: [Bug optimization/11421] [3.4 regression] vtables are not emitted in unit-at-a-time mode
- References: <20030703085958.11421.martin@mpa-garching.mpg.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11421
------- Additional Comments From jh at suse dot cz 2003-07-03 16:57 -------
Subject: Re: [3.4 regression] vtables are not emitted in unit-at-a-time mode
Hi,
does this by any chance help?
*************** void
*** 1607,1618 ****
--- 1607,1619 ----
prepare_assemble_variable (tree vars)
{
tree parent;
+ #if 1
+ tree vtbl;
+ #endif
rtx child_rtx, parent_rtx;
if (!flag_vtable_gc || TREE_CODE (vars) != VAR_DECL
|| !DECL_VTABLE_OR_VTT_P (vars))
return;
+ #if 1
+ vtbl = CLASSTYPE_VTABLES (DECL_CONTEXT (vars));
+ /* The ABI requires that we emit all of the vtables if we emit any
+ of them. */
+ if (vtbl == vars || !cgraph_varpool_node (vtbl)->needed)
+ for (; vtbl; vtbl = TREE_CHAIN (vtbl))
+ cgraph_varpool_mark_needed_node (cgraph_varpool_node (vtbl));
+ #endif
+
child_rtx = XEXP (DECL_RTL (vars), 0); /* strip the mem ref */
parent = binfo_for_vtable (vars);