This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: gnu optimization: -O3 for Fortran flags, -O2 for C flags?
On Mon, Nov 21, 2011 at 05:18:42PM -0500, Tom Roche wrote:
>
> For this build, I'm trying
>
> MFLAGS = -m64 -march=native
> OPTFLAGS = -O2 ${MFLAGS} -funroll-loops --param max-unroll-times=4 \
> -ftree-vectorize
> COPTFLAGS = ${OPTFLAGS} -Wall
> FOPTFLAGS = ${OPTFLAGS}
>
> which hopefully is neither too conservative nor too aggressive.
> Please lemme know if anything looks obviously wrong, other than -Wall:
> unfortunately gfortran goes nuts (and I go scrollblind) on this
> old code with -Wall.
If it is dusty, moldy, old code, you may need to
use one of the -finit-XXX options to initialize
all variables. Some code assumes a variable is
automatically initialized to 0. Also, while
debugging the code, if you have gfortran 4.6.0
or newer, use the -fcheck=all option. This
may catch out-of-bound array index references.
--
Steve