diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-11-27 09:34:50 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-11-27 09:34:50 +0100 |
commit | 9adeb64ab940db8fe484e6344dc28ec86f1a83bc (patch) | |
tree | 6035717443e5050e05a17efca330ad5f79e07d48 /gcc/varasm.c | |
parent | 99282f81a6bcb5873c2a3c4755f625b5a44a915d (diff) | |
download | gcc-9adeb64ab940db8fe484e6344dc28ec86f1a83bc.zip gcc-9adeb64ab940db8fe484e6344dc28ec86f1a83bc.tar.gz gcc-9adeb64ab940db8fe484e6344dc28ec86f1a83bc.tar.bz2 |
re PR target/83100 (powerpc: internal compiler error: in get_variable_section, at varasm.c:1150 with -fdata-sections)
PR target/83100
* varasm.c (bss_initializer_p): Return true for DECL_COMMON
TREE_READONLY decls.
* gcc.dg/pr83100-1.c: New test.
* gcc.dg/pr83100-2.c: New test.
* gcc.dg/pr83100-3.c: New test.
* gcc.dg/pr83100-4.c: New test.
From-SVN: r255160
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 923399d..ff912b7 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -986,9 +986,9 @@ decode_reg_name (const char *name) bool bss_initializer_p (const_tree decl) { - /* Do not put constants into the .bss section, they belong in a readonly - section. */ - return (!TREE_READONLY (decl) + /* Do not put non-common constants into the .bss section, they belong in + a readonly section. */ + return ((!TREE_READONLY (decl) || DECL_COMMON (decl)) && (DECL_INITIAL (decl) == NULL /* In LTO we have no errors in program; error_mark_node is used to mark offlined constructors. */ |