[patch] Fix PR 84487, large rodata increase in tonto and other programs

Richard Biener richard.guenther@gmail.com
Wed Apr 17 08:48:00 GMT 2019


On Wed, Apr 17, 2019 at 9:19 AM Thomas König <tk@tkoenig.net> wrote:
>
> Hi,
>
> thanks a lot for the extensive discussion :-)
>
> How should we now proceed, first for gcc 9, snd then for backporting?
> Use Richard‘s patch with the corresponding Fortran FE change?

Btw, for the testcase the fortran FE could also simply opt to not
make def_init TREE_READONLY.  Or even better, for all-zero
initialization omit the explicit initialization data and instead
mark it specially in the vtable (just use a NULL initializer
denoting zero-initialization?).  Even .bss costs (runtime) memory.

But yes, my patch would be a way to solve the middle-end issue
of promoting a variable TREE_READONLY, preventing .bss use.
And the FE could then "abuse" this feature.  Note the middle-end
already special-cases variables with an explicit section so the
Fortran FE can already use that feature to put the initializer into
.bss explicitely (set_decl_section_name (decl, ".bss"),
conditional on availability (not 100% sure how to test that...).
Your testcase probably will fail on targets w/o .bss section support.

Richard.

> Regards
>
> Thomas



More information about the Gcc-patches mailing list