Node: Use Submodel Options, Previous: Avoid f2c Compatibility, Up: Faster Programs



Use Submodel Options

Using an appropriate -m option to generate specific code for your CPU may be worthwhile, though it may mean the executable won't run on other versions of the CPU that don't support the same instruction set. See Hardware Models and Configurations. For instance on an x86 system the compiler might have been built--as shown by g77 -v--for the target i386-pc-linux-gnu, i.e. an i386 CPU. In that case to generate code best optimized for a Pentium you could use the option -march=pentium.

For recent CPUs that don't have explicit support in the released version of gcc, it might still be possible to get improvements with certain -m options.

-fomit-frame-pointer can help performance on x86 systems and others. It will, however, inhibit debugging on the systems on which it is not turned on anyway by -O.