Bug 5143 - Default optflags for some x86 machines could be better
Default optflags for some x86 machines could be better
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
i386 Linux
low Severity low
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 1999-09-14 21:43 EDT by andrewem
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-02-08 14:08:15 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description andrewem 1999-09-14 21:43:55 EDT
Default optflags for some x86 machines could be better.

I would suggest the alignment be reduced for processors
>i486.  The default of 16 bytes is best for an i486 cache
(one cache line), and wasteful on newer processors where 4
bytes will do just as well.  This reduces executable size
and improves performance slightly.
  optflags: i586 -O2 -m486 -malign-loops=2 -malign-jumps=2
  optflags: i686 -O2 -m486 -malign-loops=2 -malign-jumps=2
Note the amount is specified in powers of 2 (2^2 = 4).

The -fno-strength-reduce option probably isn't needed
anymore; it was a kludge for a rare optimizer bug that I've
only ever seen realized in the kernel, but people seem to
have gotten used to using it.

Adding the -pipe option speeds up compiles a bit, especially
on SMP systems.  The tradeoff is more memory used and less
temporary disk space used, as the compiler output is piped
directly to the assembler when this option is used.
Comment 1 andrewem 2000-02-08 14:08:59 EST
Just noticed this...

echo "int main(void){return 0;}" > test.c
gcc -O2 -c -S -fverbose-asm test.c

At the top of test.s you will find lists ("options passed:" and "options
enabled:") of all the optimization options passed and enabled.  This will be
helpful for choosing which options in addition to -O2 to add (ie. avoid
repeating options).
Comment 2 Jeff Johnson 2001-02-21 14:34:42 EST
Yes, there will always be better optflags.

FWIW, rpm can now do a better job of using different optflags for different
if necessary, using per-platform macro configurations. Feel free to send me a
with your favorite optflags instantiated in
if you want rpm to carry your per-platform (i.e. per-vendor) optflags, see
in rpm sources for where to do your dirty.

Note You need to log in before you can comment on or make changes to this bug.