summaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2002-04-23 23:51:30 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2002-04-23 23:51:30 +0000
commitf626b4890bfbc74c8ac63933b66974ed782e1758 (patch)
tree4e4586edf49f208a2bbde301aa1bd7c4e5b85dd2 /gcc/cp/decl.c
parentb07ba9ff89762078c9b3e182d9b1457e687d78eb (diff)
downloadgcc-f626b4890bfbc74c8ac63933b66974ed782e1758.tar.gz
PR c++/6395
* decl.c (make_rtl_for_nonlocal_decl): Don't mess with #pragma i/i stuff for comdats. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52696 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 58d93bc143c..fe3b4a57f4c 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7951,17 +7951,15 @@ make_rtl_for_nonlocal_decl (decl, init, asmspec)
DECL_STMT is expanded. */
defer_p = DECL_FUNCTION_SCOPE_P (decl) || DECL_VIRTUAL_P (decl);
- /* We try to defer namespace-scope static constants and template
- instantiations so that they are not emitted into the object file
- unnecessarily. */
- if ((!DECL_VIRTUAL_P (decl)
- && TREE_READONLY (decl)
- && DECL_INITIAL (decl) != NULL_TREE
- && DECL_INITIAL (decl) != error_mark_node
- && ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl))
- && toplev
- && !TREE_PUBLIC (decl))
- || DECL_COMDAT (decl))
+ /* We try to defer namespace-scope static constants so that they are
+ not emitted into the object file unnecessarily. */
+ if (!DECL_VIRTUAL_P (decl)
+ && TREE_READONLY (decl)
+ && DECL_INITIAL (decl) != NULL_TREE
+ && DECL_INITIAL (decl) != error_mark_node
+ && ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl))
+ && toplev
+ && !TREE_PUBLIC (decl))
{
/* Fool with the linkage of static consts according to #pragma
interface. */
@@ -7973,6 +7971,9 @@ make_rtl_for_nonlocal_decl (decl, init, asmspec)
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
there's an ASMSPEC. Otherwise, we'll lazily create it later when