aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/module.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index e0759a9..9bb6d264 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -11707,7 +11707,8 @@ trees_out::write_var_def (tree decl)
{
tree dyn_init = NULL_TREE;
- if (DECL_NONTRIVIALLY_INITIALIZED_P (decl))
+ /* We only need to write initializers in header modules. */
+ if (header_module_p () && DECL_NONTRIVIALLY_INITIALIZED_P (decl))
{
dyn_init = value_member (decl,
CP_DECL_THREAD_LOCAL_P (decl)