diff options
author | Jason Merrill <jason@redhat.com> | 2001-02-26 06:11:38 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2001-02-26 06:11:38 -0500 |
commit | 8cf8d8a27b3eb2b183511a3e2f449985a7aa320b (patch) | |
tree | ea9f084f1be947aa45bc7aed9c4985df654130c7 /gcc/c-decl.c | |
parent | e5dd4aad7f83c3257f4302e100b31690000e1a26 (diff) | |
download | gcc-8cf8d8a27b3eb2b183511a3e2f449985a7aa320b.zip gcc-8cf8d8a27b3eb2b183511a3e2f449985a7aa320b.tar.gz gcc-8cf8d8a27b3eb2b183511a3e2f449985a7aa320b.tar.bz2 |
c-decl.c (finish_decl): Set DECL_DEFER_OUTPUT on tentative file-scope definitions.
* c-decl.c (finish_decl): Set DECL_DEFER_OUTPUT on tentative file-scope
definitions.
* toplev.c (rest_of_decl_compilation): Check DECL_DEFER_OUTPUT to
recognize a tentative definition. Lose obsolete code.
* toplev.c (wrapup_global_declarations): Don't emit DECL_COMDAT
variables unless necessary, either.
From-SVN: r40066
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index cd6929f..c5420b0 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -3612,9 +3612,17 @@ finish_decl (decl, init, asmspec_tree) maybe_objc_check_decl (decl); if (!DECL_CONTEXT (decl)) - rest_of_decl_compilation (decl, asmspec, - (DECL_CONTEXT (decl) == 0 - || TREE_ASM_WRITTEN (decl)), 0); + { + if (DECL_INITIAL (decl) == NULL_TREE + || DECL_INITIAL (decl) == error_mark_node) + /* Don't output anything + when a tentative file-scope definition is seen. + But at end of compilation, do output code for them. */ + DECL_DEFER_OUTPUT (decl) = 1; + rest_of_decl_compilation (decl, asmspec, + (DECL_CONTEXT (decl) == 0 + || TREE_ASM_WRITTEN (decl)), 0); + } else { if (asmspec) |