On Mon, Jun 06, 2016 at 05:53:50PM -0400, Trevor Saunders wrote:
> > > As far as I can 
> > > tell this just involves moving the start of namespace selftest
> > > upwards a 
> > > bit in the files where we have tests.
> > 
> > Yes, and it does seem cleaner to have all of the selftest code start
> > like this:
> > 
> >   #if CHECKING_P
> 
> What are we gaining by ifdefing this? I would think on reasonable
> systems the compiler would optimize out the call to the selftests in
> release builds and then the linker would gc all the unused functions.
> Do we really care about code size in places that doesn't happen enough
> to go through this?

Not everyone is building the compiler with LTO, and if you don't, then
how would you optimize that away?
And yes, not having the self-tests, especially if they are going to grow
further, in release compilers is desirable, especially if it would be
intermixed with hot code.

        Jakub

Reply via email to