Commit b602511f by Jason Merrill Committed by Jason Merrill

re PR c++/6395 (gcc-3_1-branch regression for g++.old-deja/g++.jason/synth5.C)

        PR c++/6395
        * decl.c (make_rtl_for_nonlocal_decl): Don't mess with #pragma i/i
        stuff for comdats.

From-SVN: r52696
parent cff27795
2002-04-24 Jason Merrill <jason@redhat.com>
PR c++/6395
* decl.c (make_rtl_for_nonlocal_decl): Don't mess with #pragma i/i
stuff for comdats.
2002-04-23 Jakub Jelinek <jakub@redhat.com> 2002-04-23 Jakub Jelinek <jakub@redhat.com>
* parse.y (check_class_key): Allow KEY to be union/enum/struct/class * parse.y (check_class_key): Allow KEY to be union/enum/struct/class
......
...@@ -7951,17 +7951,15 @@ make_rtl_for_nonlocal_decl (decl, init, asmspec) ...@@ -7951,17 +7951,15 @@ make_rtl_for_nonlocal_decl (decl, init, asmspec)
DECL_STMT is expanded. */ DECL_STMT is expanded. */
defer_p = DECL_FUNCTION_SCOPE_P (decl) || DECL_VIRTUAL_P (decl); defer_p = DECL_FUNCTION_SCOPE_P (decl) || DECL_VIRTUAL_P (decl);
/* We try to defer namespace-scope static constants and template /* We try to defer namespace-scope static constants so that they are
instantiations so that they are not emitted into the object file not emitted into the object file unnecessarily. */
unnecessarily. */ if (!DECL_VIRTUAL_P (decl)
if ((!DECL_VIRTUAL_P (decl) && TREE_READONLY (decl)
&& TREE_READONLY (decl) && DECL_INITIAL (decl) != NULL_TREE
&& DECL_INITIAL (decl) != NULL_TREE && DECL_INITIAL (decl) != error_mark_node
&& DECL_INITIAL (decl) != error_mark_node && ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl))
&& ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl)) && toplev
&& toplev && !TREE_PUBLIC (decl))
&& !TREE_PUBLIC (decl))
|| DECL_COMDAT (decl))
{ {
/* Fool with the linkage of static consts according to #pragma /* Fool with the linkage of static consts according to #pragma
interface. */ interface. */
...@@ -7973,6 +7971,9 @@ make_rtl_for_nonlocal_decl (decl, init, asmspec) ...@@ -7973,6 +7971,9 @@ make_rtl_for_nonlocal_decl (decl, init, asmspec)
defer_p = 1; defer_p = 1;
} }
/* Likewise for template instantiations. */
else if (DECL_COMDAT (decl))
defer_p = 1;
/* If we're deferring the variable, we only need to make RTL if /* If we're deferring the variable, we only need to make RTL if
there's an ASMSPEC. Otherwise, we'll lazily create it later when there's an ASMSPEC. Otherwise, we'll lazily create it later when
......
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