public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Putting an all-zero variable into BSS
@ 2019-04-02 22:02 Thomas Koenig
  2019-04-02 22:11 ` Andreas Schwab
  0 siblings, 1 reply; 13+ messages in thread
From: Thomas Koenig @ 2019-04-02 22:02 UTC (permalink / raw)
  To: gcc mailing list, fortran

Hi,

There is a large increase in rodata size for derived types in gfortran
starting with gcc 8 due to the presence of large initializers for
derived types. Among other things, this affects SPEC tonto (PR 84487),
but there are also other bug reports which mention this behavior.

The large default initializers are all filled with zeros which end up in
the rodata section, like this:

         .text
         .globl  __types_module_MOD___def_init_types_module_Archive_type
         .section        .rodata
         .align 32
         .type 
__types_module_MOD___def_init_types_module_Archive_type, @object
         .size 
__types_module_MOD___def_init_types_module_Archive_type, 262144
__types_module_MOD___def_init_types_module_Archive_type:
         .zero   262144

... and so on. To reduce the size of the executable, it would make more
sense to put this into the BSS section.

Question: How?  It would be possible to determine from the Fortran
front end which variables would end up all zeros, and mark them in
some way. Alternatively, the middle or back end could do this,
maybe unter the control of a specal option we can then set from
gfortran (-fzero-initialized-in-bss does not do the trick).

What could be the best path forward?

Regards

	Thomas

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-04-17 15:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-02 22:02 Putting an all-zero variable into BSS Thomas Koenig
2019-04-02 22:11 ` Andreas Schwab
2019-04-03 16:45   ` Thomas Koenig
2019-04-03 21:02     ` Andreas Schwab
2019-04-04 19:53       ` Thomas Koenig
2019-04-05 10:15         ` Richard Biener
2019-04-06 13:59           ` Thomas Koenig
2019-04-07  9:26             ` Richard Biener
2019-04-07 16:03               ` Thomas Koenig
2019-04-08  8:38                 ` Andrew Haley
2019-04-08  9:33                   ` Richard Biener
2019-04-08  9:40                     ` Richard Biener
2019-04-17 15:14                       ` Joseph Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).