Re: g++keeps unused objects with virtual functions

2015-04-08 Thread Richard Biener
il 2015 12:14 > An: Stefan Ehrlich > Cc: Jan Hubicka; GCC Development; zl...@acm.org > Betreff: Re: g++keeps unused objects with virtual functions > > On Wed, Apr 8, 2015 at 11:59 AM, Stefan Ehrlich > wrote: >> But without the virtual keyword the global object never read

Re: g++keeps unused objects with virtual functions

2015-04-08 Thread Richard Biener
> Von: Jan Hubicka [mailto:hubi...@ucw.cz] > Gesendet: Mittwoch, 08. April 2015 11:00 > An: Jan Hubicka > Cc: Richard Biener; Stefan Ehrlich; GCC Development; zl...@acm.org > Betreff: Re: g++keeps unused objects with virtual functions > >> > which show

Re: g++keeps unused objects with virtual functions

2015-04-08 Thread Jan Hubicka
> > which shows how the global objects initialization keeps things live. > > Early optimization turns it into > > > > (static initializers for t.C) () > > { > > : > > NotUsedObject._vptr.CObject = &MEM[(void *)&_ZTV7CObject + 16B]; > > return; > > > > } > > > > but we don't have any pass r

Re: g++keeps unused objects with virtual functions

2015-04-08 Thread Jan Hubicka
> which shows how the global objects initialization keeps things live. > Early optimization turns it into > > (static initializers for t.C) () > { > : > NotUsedObject._vptr.CObject = &MEM[(void *)&_ZTV7CObject + 16B]; > return; > > } > > but we don't have any pass removing stores to global

Re: g++keeps unused objects with virtual functions

2015-04-08 Thread Richard Biener
) > (.data + .bss + .noinit) > > > I added the -fwhole-program flag (as mentioned by Zan Lynx) but without any > effect. > Is here something missing or too much? > > Lg > > Stefan > > > -Ursprüngliche Nachricht- > Von: Richard Biener [mailto:richard.guent

Re: g++keeps unused objects with virtual functions

2015-04-08 Thread Richard Biener
On Wed, Apr 8, 2015 at 1:11 AM, Zan Lynx wrote: > On 04/07/2015 09:00 AM, Stefan Ehrlich wrote: >> compiler and linker options are: >> avr-g++.exe -c -Os -Wall -fdata-sections -ffunction-sections >> -fvisibility=hidden -fvisibility-inlines-hidden -fno-rtti -flto >> -fuse-linker-plugin -mmcu=atm

Re: g++keeps unused objects with virtual functions

2015-04-07 Thread Zan Lynx
On 04/07/2015 09:00 AM, Stefan Ehrlich wrote: > compiler and linker options are: > avr-g++.exe -c -Os -Wall -fdata-sections -ffunction-sections > -fvisibility=hidden -fvisibility-inlines-hidden -fno-rtti -flto > -fuse-linker-plugin -mmcu=atmega8 ... > avr-gcc.exe -Wall -Os -Wl,-static -Wl,-flto

Re: g++keeps unused objects with virtual functions

2015-04-07 Thread Richard Biener
On April 7, 2015 5:00:27 PM GMT+02:00, Stefan Ehrlich wrote: >Hello GCC developer team, >I hope I am right here to address my problem with memory usage and g++: > >I am writing C++ software for several very small embedded systems (8k >and smaller) and a feature with the virtual tables and the li