diff options
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl.c | 14 | ||||
-rw-r--r-- | gcc/toplev.c | 4 |
4 files changed, 14 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c9d8ff6..dfed0a7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-11-15 Mark Mitchell <mark@codesourcery.com> + + * toplev.c (wrapup_global_declarations): Don't write out + artificial static variables that aren't needed. + 2000-11-15 Bernd Schmidt <bernds@redhat.co.uk> * ia64.c (struct group): New structure. diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c5a369c..5294676 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-11-15 Mark Mitchell <mark@codesourcery.com> + + * decl.c (wrapup_globals_for_namespace): Don't mark things + TREE_ASM_WRITTEN when they're not. + 2000-11-15 Jason Merrill <jason@redhat.com> * typeck2.c (friendly_abort): Uncount the error before handing diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 0d677fe..192a7cd 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1926,20 +1926,8 @@ wrapup_globals_for_namespace (namespace, data) /* Process the decls in reverse order--earliest first. Put them into VEC from back to front, then take out from front. */ - for (i = 0, decl = globals; i < len; i++, decl = TREE_CHAIN (decl)) - { - /* Pretend we've output an unused static variable. This ensures - that the toplevel __FUNCTION__ etc won't be emitted, unless - needed. */ - if (TREE_CODE (decl) == VAR_DECL && DECL_ARTIFICIAL (decl) - && !TREE_PUBLIC (decl) && !TREE_USED (decl)) - { - TREE_ASM_WRITTEN (decl) = 1; - DECL_IGNORED_P (decl) = 1; - } - vec[len - i - 1] = decl; - } + vec[len - i - 1] = decl; if (last_time) { diff --git a/gcc/toplev.c b/gcc/toplev.c index 95955fb..d25085a 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1950,7 +1950,9 @@ wrapup_global_declarations (vec, len) if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl) && (! TREE_READONLY (decl) || TREE_PUBLIC (decl) - || (!optimize && flag_keep_static_consts) + || (!optimize + && flag_keep_static_consts + && !DECL_ARTIFICIAL (decl)) || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))) { reconsider = 1; |