Commit 9a9a9643 by Richard Stallman

(rest_of_decl_compilation): Don't look at DECL_IGNORED_P.

Don't output a read-only initialized extern variable.

From-SVN: r5105
parent fe23d5ad
...@@ -2163,18 +2163,19 @@ rest_of_decl_compilation (decl, asmspec, top_level, at_end) ...@@ -2163,18 +2163,19 @@ rest_of_decl_compilation (decl, asmspec, top_level, at_end)
TIMEVAR (varconst_time, TIMEVAR (varconst_time,
{ {
make_decl_rtl (decl, asmspec, top_level); make_decl_rtl (decl, asmspec, top_level);
/* For a user-invisible decl that should be replaced /* Initialized extern variable exists to be replaced
by its value when used, don't output anything. */ with its value, or represents something that will be
output in another file. */
if (! (TREE_CODE (decl) == VAR_DECL if (! (TREE_CODE (decl) == VAR_DECL
&& DECL_IGNORED_P (decl) && TREE_READONLY (decl) && DECL_EXTERNAL (decl) && TREE_READONLY (decl)
&& DECL_INITIAL (decl) != 0)) && DECL_INITIAL (decl) != 0
&& DECL_INITIAL (decl) != error_mark_node)
/* Don't output anything /* Don't output anything
when a tentative file-scope definition is seen. when a tentative file-scope definition is seen.
But at end of compilation, do output code for them. */ But at end of compilation, do output code for them. */
if (! (! at_end && top_level if (! (! at_end && top_level
&& (DECL_INITIAL (decl) == 0 && (DECL_INITIAL (decl) == 0
|| DECL_INITIAL (decl) == error_mark_node || DECL_INITIAL (decl) == error_mark_node)))
|| DECL_IGNORED_P (decl))))
assemble_variable (decl, top_level, at_end, 0); assemble_variable (decl, top_level, at_end, 0);
}); });
else if (DECL_REGISTER (decl) && asmspec != 0) else if (DECL_REGISTER (decl) && asmspec != 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment