This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ patch] Fix one of PPC bootstrap problems
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org, mark at codesourcery dot com
- Date: Sun, 7 Sep 2003 02:15:25 +0200
- Subject: [C++ patch] Fix one of PPC bootstrap problems
Mark,
PPC runs into problem because C++ frontend several times finalize the
same variable. It changes the mind from normal variable into comdat
in between first and second time. I am not quite sure why that happens,
but surely we should not re-do everything over and over.
Sun Sep 7 02:10:37 CEST 2003 Jan HUbicka <jh@suse.cz>
* decl2.c (maybe_emit_vtables, write_out_vars, finish_file):
Avoid re-emitting variables in unit-at-a-time mode.
Index: decl2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
retrieving revision 1.667
diff -c -3 -p -r1.667 decl2.c
*** decl2.c 5 Sep 2003 08:24:19 -0000 1.667
--- decl2.c 7 Sep 2003 00:12:32 -0000
*************** maybe_emit_vtables (tree ctype)
*** 1634,1640 ****
/* If the vtables for this class have already been emitted there is
nothing more to do. */
primary_vtbl = CLASSTYPE_VTABLES (ctype);
! if (TREE_ASM_WRITTEN (primary_vtbl))
return false;
/* Ignore dummy vtables made by get_vtable_decl. */
if (TREE_TYPE (primary_vtbl) == void_type_node)
--- 1634,1642 ----
/* If the vtables for this class have already been emitted there is
nothing more to do. */
primary_vtbl = CLASSTYPE_VTABLES (ctype);
! if (TREE_ASM_WRITTEN (primary_vtbl)
! || (flag_unit_at_a_time
! && cgraph_varpool_node (primary_vtbl)->finalized))
return false;
/* Ignore dummy vtables made by get_vtable_decl. */
if (TREE_TYPE (primary_vtbl) == void_type_node)
*************** write_out_vars (tree vars)
*** 2452,2458 ****
tree v;
for (v = vars; v; v = TREE_CHAIN (v))
! if (! TREE_ASM_WRITTEN (TREE_VALUE (v)))
rest_of_decl_compilation (TREE_VALUE (v), 0, 1, 1);
}
--- 2454,2462 ----
tree v;
for (v = vars; v; v = TREE_CHAIN (v))
! if (! TREE_ASM_WRITTEN (TREE_VALUE (v))
! && (!flag_unit_at_a_time
! || !cgraph_varpool_node (TREE_VALUE (v))->finalized))
rest_of_decl_compilation (TREE_VALUE (v), 0, 1, 1);
}
*************** finish_file ()
*** 2875,2881 ****
for (i = 0; i < pending_statics_used; ++i)
{
tree decl = VARRAY_TREE (pending_statics, i);
! if (TREE_ASM_WRITTEN (decl))
continue;
import_export_decl (decl);
if (DECL_NOT_REALLY_EXTERN (decl) && ! DECL_IN_AGGR_P (decl))
--- 2878,2886 ----
for (i = 0; i < pending_statics_used; ++i)
{
tree decl = VARRAY_TREE (pending_statics, i);
! if (TREE_ASM_WRITTEN (decl)
! || (flag_unit_at_a_time
! && cgraph_varpool_node (decl)->finalized))
continue;
import_export_decl (decl);
if (DECL_NOT_REALLY_EXTERN (decl) && ! DECL_IN_AGGR_P (decl))