Mail Archives: djgpp/2000/01/17/15:51:07
djgpp AT delorie DOT com (Eli Zaretskii) wrote in
<Pine DOT SUN DOT 3 DOT 91 DOT 1000117161103 DOT 23941A-100000 AT is>:
>In what DJGPP distribution(s) did you see -O6?
At least in allegro.
>AFAIK, the absolute
>majority use -O2. -O6 was a no-op until GCC 2.9x (or EGCS before it)
>came into existence.
I believe, it was not a no-op, but rather was an alias to -O2.
Btw. I always use -O. For my programs this always almost produces
the fastest code. And I tried this with various hardware and
with FPU intensive code as well as with code that doesn´t
need the FPU. I started with djgpp on a 386SX with 16 MHz.
I thought this may be due to my ancient hardware. I upgraded to
an 486 with 66 MHz and used the -m486. Often the -m486 would result
in slower code and -O2 almost always produced slower code then -O.
Recently I upgraded to AMD K6-2 266 MHz (running at 333 MHz).
The same thing. Almost all my programs run fastest when compiled
with -O (and -fomit-frame-pointer -ffast-math).
Also I upgraded gcc. From (I believe) 1.39 upto 2.9.2 now.
The fastest code seems to be produced by 2.7.3. Even when I
compile with -march=k6 or -march=586 with 2.9.2, it won´t produce
faster code then 2.7.3 in the examples I tested [1].
So, am I stupid or has anybody got similar experiences? Do all
the -O2 users have acutally tried to use -O only, or do you
all think, as I did, that higher optimization level should produce
faster code?
Note, theat my experiences are mostly for C, not for C++, which
I useally don´t use.
[1] I only have gcc 2.9.2 very recently. But I tested all I said
with gcc 2.8.x versions on many different programs, my own and
public available ones. I.e. my chess engine was about 20% slower
when compiled with 2.8 versions of gcc, compared to gcc 2.7.3.
The same is true for crafty, a freely available chess program.
Crafty uses unsigned long long extensively, while my program
doesn´t use it at all. Simular figures I obtained for quantum
chemical simulations.
Regards,
Dieter
- Raw text -