This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

optimization/193: Automaticly eliminating redundant zero initialisers



>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:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]