+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.
+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
/* 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)
{
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;