Commit 08a8c6b6 by Jan Beulich Committed by Richard Henderson

varasm.c (assemble_variable): Use assemble_zeros for zero-initialized variables.

        * varasm.c (assemble_variable): Use assemble_zeros for
        zero-initialized variables.
        (categorize_decl_for_section): Honor flag_zero_initialized_in_bss
        for SECCAT_BSS and SECCAT_TBSS.

Co-Authored-By: Richard Henderson <rth@redhat.com>

From-SVN: r84271
parent 78a47b1d
2004-07-06 Jan Beulich <jbeulich@novell.com> 2004-07-07 Jan Beulich <jbeulich@novell.com>
Richard Henderson <rth@redhat.com>
* varasm.c (assemble_variable): Use assemble_zeros for
zero-initialized variables.
(categorize_decl_for_section): Honor flag_zero_initialized_in_bss
for SECCAT_BSS and SECCAT_TBSS.
2004-07-07 Jan Beulich <jbeulich@novell.com>
* varasm.c (asm_output_bss): Don't declare unless BSS_SECTION_ASM_OP. * varasm.c (asm_output_bss): Don't declare unless BSS_SECTION_ASM_OP.
* expmed.c (emit_store_flag): Also special-case double-word * expmed.c (emit_store_flag): Also special-case double-word
(in-)equality comparison against -1. (in-)equality comparison against -1.
* config/i386/i386.c (ix86_gimplify_va_arg): Don't need temporary for * config/i386/i386.c (ix86_gimplify_va_arg): Don't need temporary for
passing arguments the containers for which are registers. passing arguments the containers for which are registers.
......
...@@ -1563,7 +1563,9 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED, ...@@ -1563,7 +1563,9 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
if (!dont_output_data) if (!dont_output_data)
{ {
if (DECL_INITIAL (decl) && DECL_INITIAL (decl) != error_mark_node) if (DECL_INITIAL (decl)
&& DECL_INITIAL (decl) != error_mark_node
&& !initializer_zerop (DECL_INITIAL (decl)))
/* Output the actual data. */ /* Output the actual data. */
output_constant (DECL_INITIAL (decl), output_constant (DECL_INITIAL (decl),
tree_low_cst (DECL_SIZE_UNIT (decl), 1), tree_low_cst (DECL_SIZE_UNIT (decl), 1),
...@@ -4611,7 +4613,11 @@ categorize_decl_for_section (tree decl, int reloc, int shlib) ...@@ -4611,7 +4613,11 @@ categorize_decl_for_section (tree decl, int reloc, int shlib)
else if (TREE_CODE (decl) == VAR_DECL) else if (TREE_CODE (decl) == VAR_DECL)
{ {
if (DECL_INITIAL (decl) == NULL if (DECL_INITIAL (decl) == NULL
|| DECL_INITIAL (decl) == error_mark_node) || 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))))
ret = SECCAT_BSS; ret = SECCAT_BSS;
else if (! TREE_READONLY (decl) else if (! TREE_READONLY (decl)
|| TREE_SIDE_EFFECTS (decl) || TREE_SIDE_EFFECTS (decl)
...@@ -4653,7 +4659,11 @@ categorize_decl_for_section (tree decl, int reloc, int shlib) ...@@ -4653,7 +4659,11 @@ categorize_decl_for_section (tree decl, int reloc, int shlib)
/* There are no read-only thread-local sections. */ /* There are no read-only thread-local sections. */
if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl)) if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL (decl))
{ {
if (ret == SECCAT_BSS) /* 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))))
ret = SECCAT_TBSS; ret = SECCAT_TBSS;
else else
ret = SECCAT_TDATA; ret = SECCAT_TDATA;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment