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

2019-04-17 Thread Florian Weimer
* Andreas Schwab: > On Apr 17 2019, Florian Weimer wrote: > >> * Andreas Schwab: >> >>> On Apr 17 2019, Florian Weimer wrote: >>> Not just that, .bss adds to the commit charge, >>> >>> Only one page at most. >> >> That would be a bug. > > You cannot avoid it for the page shared with .data,

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

2019-04-17 Thread Andreas Schwab
On Apr 17 2019, Florian Weimer wrote: > * Andreas Schwab: > >> On Apr 17 2019, Florian Weimer wrote: >> >>> Not just that, .bss adds to the commit charge, >> >> Only one page at most. > > That would be a bug. You cannot avoid it for the page shared with .data, unless you force .bss to be page a

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

2019-04-17 Thread Florian Weimer
* Andreas Schwab: > On Apr 17 2019, Florian Weimer wrote: > >> Not just that, .bss adds to the commit charge, > > Only one page at most. That would be a bug. All of it is anonymous memory which needs backing from RAM or swap, in case the process writes to it. Thanks, Florian

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

2019-04-17 Thread Andreas Schwab
On Apr 17 2019, Florian Weimer wrote: > Not just that, .bss adds to the commit charge, Only one page at most. Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

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

2019-04-17 Thread Florian Weimer
* Richard Biener: > On Wed, Apr 17, 2019 at 9:19 AM Thomas König 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 testc

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

2019-04-17 Thread Richard Biener
On Wed, Apr 17, 2019 at 9:19 AM Thomas König 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 s

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

2019-04-17 Thread Thomas König
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? Regards Thomas

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

2019-04-16 Thread Segher Boessenkool
On Tue, Apr 16, 2019 at 12:16:16PM +0200, Jakub Jelinek wrote: > On Tue, Apr 16, 2019 at 11:33:39AM +0200, Florian Weimer wrote: > > * Segher Boessenkool: > > > > > On Mon, Apr 15, 2019 at 01:54:11PM +0200, Florian Weimer wrote: > > >> * Richard Biener: > > >> > > >> > Of course adding sth like a

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

2019-04-16 Thread Jakub Jelinek
On Tue, Apr 16, 2019 at 11:33:39AM +0200, Florian Weimer wrote: > * Segher Boessenkool: > > > On Mon, Apr 15, 2019 at 01:54:11PM +0200, Florian Weimer wrote: > >> * Richard Biener: > >> > >> > Of course adding sth like a .robss section would be nice. > >> > >> I think this is strictly a link edi

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

2019-04-16 Thread Segher Boessenkool
On Tue, Apr 16, 2019 at 12:05:56PM +0200, Richard Biener wrote: > On Tue, Apr 16, 2019 at 11:33 AM Florian Weimer wrote: > > > > * Segher Boessenkool: > > > > > On Mon, Apr 15, 2019 at 01:54:11PM +0200, Florian Weimer wrote: > > >> * Richard Biener: > > >> > > >> > Of course adding sth like a .rob

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

2019-04-16 Thread Segher Boessenkool
On Tue, Apr 16, 2019 at 11:33:39AM +0200, Florian Weimer wrote: > * Segher Boessenkool: > > > On Mon, Apr 15, 2019 at 01:54:11PM +0200, Florian Weimer wrote: > >> * Richard Biener: > >> > >> > Of course adding sth like a .robss section would be nice. > >> > >> I think this is strictly a link edi

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

2019-04-16 Thread Richard Biener
On Tue, Apr 16, 2019 at 11:33 AM Florian Weimer wrote: > > * Segher Boessenkool: > > > On Mon, Apr 15, 2019 at 01:54:11PM +0200, Florian Weimer wrote: > >> * Richard Biener: > >> > >> > Of course adding sth like a .robss section would be nice. > >> > >> I think this is strictly a link editor issue

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

2019-04-16 Thread Florian Weimer
* Segher Boessenkool: > On Mon, Apr 15, 2019 at 01:54:11PM +0200, Florian Weimer wrote: >> * Richard Biener: >> >> > Of course adding sth like a .robss section would be nice. >> >> I think this is strictly a link editor issue because a read-only PT_LOAD >> directive with a memory size larger tha

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

2019-04-15 Thread Segher Boessenkool
On Mon, Apr 15, 2019 at 01:54:11PM +0200, Florian Weimer wrote: > * Richard Biener: > > > Of course adding sth like a .robss section would be nice. > > I think this is strictly a link editor issue because a read-only PT_LOAD > directive with a memory size larger than the file size already produce

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

2019-04-15 Thread Florian Weimer
* Richard Biener: > Of course adding sth like a .robss section would be nice. I think this is strictly a link editor issue because a read-only PT_LOAD directive with a memory size larger than the file size already produces read-only zero pages, without requiring a file allocation. Thanks, Floria

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

2019-04-15 Thread Jan Hubicka
> > This won't work with LTO. Note we have the issue in the middle-end as well > since we promote variables we see are not written to to TREE_READONLY. > This can be seen with (the somewhat artificial...): > > int a[1024*1024] = { 0 }; > > int __attribute__((noinline)) foo() { return *(volatile

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

2019-04-15 Thread Richard Biener
On Sat, Apr 13, 2019 at 8:48 PM Thomas Koenig wrote: > > Hello world, > > the attached patch fixes a 8/9 regression where _def_init, an internal > Fortran variable containing only zeros, was placed into the .rodata > section. This led to a large increase in executable size. > > There should be no

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

2019-04-13 Thread Paul Richard Thomas
Hi Thomas, Thanks for your determination in dealing with this. It has been on my TODO list for a long time but, like you at the outset, I had no idea how to deal with it. OK on the fortran side. Paul On Sat, 13 Apr 2019 at 19:48, Thomas Koenig wrote: > > Hello world, > > the attached patch fix

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

2019-04-13 Thread Thomas Koenig
Hello world, the attached patch fixes a 8/9 regression where _def_init, an internal Fortran variable containing only zeros, was placed into the .rodata section. This led to a large increase in executable size. There should be no impact on other languages because the change to varasm.c is guarded