aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-08-08 08:33:22 +0000
committerRichard Stallman <rms@gnu.org>1993-08-08 08:33:22 +0000
commit9a9a96439d8d21240451a9f2341dde7829f20c7b (patch)
treee5ed0ed00aed85f5249a4967117ba44850dc4a8e
parentfe23d5ada2a7090c161ca48c79e9e4dcb51db267 (diff)
downloadgcc-9a9a96439d8d21240451a9f2341dde7829f20c7b.zip
gcc-9a9a96439d8d21240451a9f2341dde7829f20c7b.tar.gz
gcc-9a9a96439d8d21240451a9f2341dde7829f20c7b.tar.bz2
(rest_of_decl_compilation): Don't look at DECL_IGNORED_P.
Don't output a read-only initialized extern variable. From-SVN: r5105
-rw-r--r--gcc/toplev.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 1df2cff..4d2c42b 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -2163,18 +2163,19 @@ rest_of_decl_compilation (decl, asmspec, top_level, at_end)
TIMEVAR (varconst_time,
{
make_decl_rtl (decl, asmspec, top_level);
- /* For a user-invisible decl that should be replaced
- by its value when used, don't output anything. */
+ /* Initialized extern variable exists to be replaced
+ with its value, or represents something that will be
+ output in another file. */
if (! (TREE_CODE (decl) == VAR_DECL
- && DECL_IGNORED_P (decl) && TREE_READONLY (decl)
- && DECL_INITIAL (decl) != 0))
+ && DECL_EXTERNAL (decl) && TREE_READONLY (decl)
+ && DECL_INITIAL (decl) != 0
+ && 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. */
if (! (! at_end && top_level
&& (DECL_INITIAL (decl) == 0
- || DECL_INITIAL (decl) == error_mark_node
- || DECL_IGNORED_P (decl))))
+ || DECL_INITIAL (decl) == error_mark_node)))
assemble_variable (decl, top_level, at_end, 0);
});
else if (DECL_REGISTER (decl) && asmspec != 0)