summaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-15 01:43:07 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-15 01:43:07 +0000
commitc55e96a8a069ecc481e469c389e2b8e52fee1233 (patch)
tree2f234f8733535067850f91645ed976b5228e1fdd /gcc/varasm.c
parent0f5a9301e49f938b030f7bf22e3c3d2319a58936 (diff)
downloadgcc-c55e96a8a069ecc481e469c389e2b8e52fee1233.tar.gz
PR optimization/6871
* varasm.c (assemble_variable): Leave constant zeroes in .rodata. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64387 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index dea352a9097..42775dca5bc 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1551,6 +1551,8 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
else if (DECL_INITIAL (decl) == 0
|| DECL_INITIAL (decl) == error_mark_node
|| (flag_zero_initialized_in_bss
+ /* Leave constant zeroes in .rodata so they can be shared. */
+ && !TREE_READONLY (decl)
&& initializer_zerop (DECL_INITIAL (decl))))
{
unsigned HOST_WIDE_INT size = tree_low_cst (DECL_SIZE_UNIT (decl), 1);