This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
optimization/193: Automaticly eliminating redundant zero initialisers
- To: gcc-gnats at gcc dot gnu dot org
- Subject: optimization/193: Automaticly eliminating redundant zero initialisers
- From: greyham at research dot canon dot com dot au
- Date: 3 May 2000 02:56:32 -0000
- Reply-To: greyham at research dot canon dot com dot au
- Resent-Cc: gcc-prs at gcc dot gnu dot org
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, greyham@research.canon.com.au
>Number: 193
>Category: optimization
>Synopsis: Automaticly eliminating redundant zero initialisers
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: pessimizes-code
>Submitter-Id: net
>Arrival-Date: Tue May 02 20:06:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Graham Stoney
>Release: 2.95.2
>Organization:
>Environment:
powerpc-linux
>Description:
Under ANSI-C, uninitialised statics are implicitly initialised
to all-bits-zero. Some programmers still prefer to explicitly
initialise them to zero though, which wastes .data space in
conforming environments where the runtime code zero fills .bss.
It would be nice if -Os (Optimise for space) treated these
redundant zero initialisations as though they weren't there.
In other words, treat these the same:
static int initialised=0; /* wastes space in .data */
static int uninitialised; /* implicitly zero, and more efficient */
Given that we may still wish to support non-conforming
environments where .bss is not zero-filled, it might be wise
to provide a -fno-zeroed-bss option for folks unwilling to
fix such environments.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: