[Qt-interest] doubt about the qmake makespec
Andreas Pakulat
apaku at gmx.de
Mon Feb 9 20:45:54 CET 2009
On 09.02.09 23:31:54, Raghavendra Nayak wrote:
>
> Hi all,
>
> This is my first post in this mailing list. I have a doubt regarding qmake default settings ie; qmake.conf
>
> If you check qmake.conf present inside the makespecs directory of qt installation directory, you will see that qmake.conf of all makespecs which use gcc as the compiler has following line in them
>
> QMAKE_CFLAGS_RELEASE += -O2
>
> This line is used to set the optimization level of the release binary. In this case O2 optimization will be used for release build.
>
> My question is that, why highest possible optimization -O3 is not used by default ? Why -O2 is used instead as the default optimization ? Whether O2 setting is selected simply or there is any particular reason behind this ? I am planning to use O3 setting for my release binaries, is there any problem with this ?
I don't know how the state of gcc wrt. -O3 is nowadays, but at least in the
(not so ancient) past gcc produced buggy code when used with -O3. And more
importantly there's little if any measurable difference between compiling
with -O2 and -O3 with most apps. So QtSoftware is just making sure to be on
the safe side by using -O2 for release builds.
Andreas
--
You will soon meet a person who will play an important role in your life.
More information about the Qt-interest-old
mailing list