From c57e159892e138cdb46977dc063d8a3a9aa91281 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 7 Sep 2003 13:15:46 +0200 Subject: [PATCH] decl2.c (maybe_emit_vtables, [...]): Avoid re-emitting variables in unit-at-a-time mode. * decl2.c (maybe_emit_vtables, write_out_vars, finish_file): Avoid re-emitting variables in unit-at-a-time mode. From-SVN: r71167 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/decl2.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1c8fef02573..dccc52680b2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +Sun Sep 7 13:15:14 CEST 2003 Jan Hubicka + + * decl2.c (maybe_emit_vtables, write_out_vars, finish_file): + Avoid re-emitting variables in unit-at-a-time mode. + 2003-09-06 Mark Mitchell PR c++/11687 diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index dfbffa720a0..e1fe1209c97 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1634,7 +1634,9 @@ maybe_emit_vtables (tree ctype) /* 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)) + 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) @@ -2452,7 +2454,9 @@ write_out_vars (tree vars) tree v; for (v = vars; v; v = TREE_CHAIN (v)) - if (! TREE_ASM_WRITTEN (TREE_VALUE (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); } @@ -2875,7 +2879,9 @@ finish_file () for (i = 0; i < pending_statics_used; ++i) { tree decl = VARRAY_TREE (pending_statics, i); - if (TREE_ASM_WRITTEN (decl)) + 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)) -- 2.30.2