This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: bss section not getting zero-initialised vars
On Wed, Jan 19, 2000 at 12:16:24AM -0800, Mark Mitchell wrote:
> I think that if someone contributes the code to do this optimization,
> we should accept it.
Well, it's pretty easy to do, if that's what you really want. I'll
warrent that you'll break a number of programs though, e.g. emacs.
All you'd have to do is change assemble_variable:
/* Handle uninitialized definitions. */
if ((DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node)
/* If the target can't output uninitialized but not common global data
in .bss, then we have to use .data. */
#if ! defined ASM_EMIT_BSS
&& DECL_COMMON (decl)
#endif
to include a check for DECL_INITIAL being all zeros. This should
probably only use .bss, so that we don't turn these info common
data.
r~