Most Fortran users will want to use no optimization when developing and testing programs, and use `-O' or `-O2' when compiling programs for late-cycle testing and for production use.
The following flags have particular applicability when compiling Fortran programs:
-malign-double
g77
programs making
heavy use of REAL(KIND=2)
(DOUBLE PRECISION
) data
on some systems.
In particular, systems using Pentium, Pentium Pro, 586, and
686 implementations
of the i386 architecture execute programs faster when
REAL(KIND=2)
(DOUBLE PRECISION
) data are
aligned on 64-bit boundaries
in memory.
This option can, at least, make benchmark results more consistent
across various system configurations, versions of the program,
and data sets.
Note: The warning in the gcc
documentation about
this option does not apply, generally speaking, to Fortran
code compiled by g77
.
Also note: g77
fixes a gcc
backend bug to allow
`-malign-double' to work generally, not just with
statically-allocated data.
Also also note: The negative form of `-malign-double'
is `-mno-align-double', not `-benign-double'.
-ffloat-store
-fforce-mem
-fforce-addr
-fno-inline
-ffast-math
-fstrength-reduce
-frerun-cse-after-loop
-fexpensive-optimizations
-fdelayed-branch
-fschedule-insns
-fschedule-insns2
-fcaller-saves
-funroll-loops
-funroll-all-loops
-fno-move-all-movables
-fno-reduce-all-givs
-fno-rerun-loop-opt
gcc
command-line options.
See section `Options That Control Optimization' in Using and Porting GNU CC, for more information on options to optimize the generated machine code.
Go to the first, previous, next, last section, table of contents.