aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-symtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/lto-symtab.c')
-rw-r--r--gcc/lto-symtab.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c
index 7d304484..2a0783a 100644
--- a/gcc/lto-symtab.c
+++ b/gcc/lto-symtab.c
@@ -323,8 +323,10 @@ lto_symtab_register_decl (tree decl,
&& (TREE_CODE (decl) == VAR_DECL
|| TREE_CODE (decl) == FUNCTION_DECL)
&& DECL_ASSEMBLER_NAME_SET_P (decl));
- if (TREE_CODE (decl) == VAR_DECL)
- gcc_assert (!(DECL_EXTERNAL (decl) && DECL_INITIAL (decl)));
+ if (TREE_CODE (decl) == VAR_DECL
+ && DECL_INITIAL (decl))
+ gcc_assert (!DECL_EXTERNAL (decl)
+ || (TREE_STATIC (decl) && TREE_READONLY (decl)));
if (TREE_CODE (decl) == FUNCTION_DECL)
gcc_assert (!DECL_ABSTRACT (decl));