aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-09-06 11:10:26 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2017-09-06 11:10:26 +0200
commit3581d5dbf0c6be20e837ea27092b38f5de23c93b (patch)
treecb6dca3083d740ac791bc9bf2cc47f6124352f4d /gcc/varasm.c
parent58565a2ec16925841c2a97aaa1ab8eff63bc6f3e (diff)
downloadgcc-3581d5dbf0c6be20e837ea27092b38f5de23c93b.zip
gcc-3581d5dbf0c6be20e837ea27092b38f5de23c93b.tar.gz
gcc-3581d5dbf0c6be20e837ea27092b38f5de23c93b.tar.bz2
re PR middle-end/82095 (ICE in tree_nop_conversion at tree.c:11793 on ppc64le)
PR middle-end/82095 * varasm.c (categorize_decl_for_section): Use SECCAT_TBSS for TLS vars with NULL DECL_INITIAL. * gcc.dg/tls/pr82095.c: New test. From-SVN: r251754
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index f2a12f0..6177eec 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -6562,8 +6562,9 @@ categorize_decl_for_section (const_tree decl, int reloc)
/* Note that this would be *just* SECCAT_BSS, except that there's
no concept of a read-only thread-local-data section. */
if (ret == SECCAT_BSS
- || (flag_zero_initialized_in_bss
- && initializer_zerop (DECL_INITIAL (decl))))
+ || DECL_INITIAL (decl) == NULL
+ || (flag_zero_initialized_in_bss
+ && initializer_zerop (DECL_INITIAL (decl))))
ret = SECCAT_TBSS;
else
ret = SECCAT_TDATA;