[Bug optimization/11421] [3.4 regression] vtables are not emitted in unit-at-a-time mode

jh at suse dot cz gcc-bugzilla@gcc.gnu.org
Thu Jul 3 16:57:00 GMT 2003


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);



More information about the Gcc-bugs mailing list