gcc flags for developers (Re: [PATCH] a little optimization of KJS GarbageCollector)

David Faure faure at kde.org
Fri Dec 2 13:07:44 GMT 2005


On Thursday 01 December 2005 17:51, Dirk Mueller wrote:
> On Thursday 01 December 2005 17:34, Martijn Klingens wrote:
> 
> > Do I understand correctly that --enable-debug (without =full) gives the -O2
> > -fno-reorder-blocks -fno-schedule-insns -fno-inline that you mentioned?
> 
> No, it gives you "-O2 -g" for historic reasons. 

Can we change the defaults so that reasonable/useful flags are being used then?

Problem is, I see two possibilities, for developers:
1) with debug but with -O0 so that gcc runs fast   (or does -O1 make gcc fast enough?)
2) with debug and with "-O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline"
  so that the code runs faster and so that all warnings can be seen.

Does this mean it would make sense to have
 --enable-debug=fast for the first one,  and make --enable-debug select the second one?

or maybe
 --enable-debug=fast for the first one and --enable-debug=optimized for the second one,
to keep the current --enable-debug as -O2 -g? Although I don't see any point in
leaving things unchanged 'for historical reasons' if everyone agrees that it's wrong that way.

Not everyone is a gcc expert, we should select the right flags so that developers
don't have to care about all this.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).





More information about the kde-core-devel mailing list