This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/41082] [4.5 Regression] FAIL: gfortran.fortran-torture/execute/where_2.f90 execution, -O3 -g with -m64
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Aug 2009 08:30:31 -0000
- Subject: [Bug middle-end/41082] [4.5 Regression] FAIL: gfortran.fortran-torture/execute/where_2.f90 execution, -O3 -g with -m64
- References: <bug-41082-12313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from rguenther at suse dot de 2009-08-19 08:30 -------
Subject: Re: [4.5 Regression] FAIL:
gfortran.fortran-torture/execute/where_2.f90 execution, -O3 -g with -m64
On Tue, 18 Aug 2009, dominiq at lps dot ens dot fr wrote:
> ------- Comment #2 from dominiq at lps dot ens dot fr 2009-08-18 20:03 -------
> The manual says:
>
> -O3
> Optimize yet more. -O3 turns on all optimizations specified by -O2 and also
> turns on the -finline-functions, -funswitch-loops, -fpredictive-commoning,
> -fgcse-after-reload and -ftree-vectorize options.
>
> but I see:
>
> [karma] f90/bug% gfc -m64 -O2 -ftree-vectorize -finline-functions
> -funswitch-loops -fpredictive-commoning -fgcse-after-reload where_2.f90
> [karma] f90/bug% a.out
> 100 100 100 210 210 210
> 310 310 337 337
> [karma] f90/bug% gfc -m64 -O3 where_2.f90
> [karma] f90/bug% a.out
> 100 100 100 210 210 210
> 310 310 310 310
> Abort
>
> What are the missing differences between -O2 and -O3?
from opts.c:
/* -O3 optimizations. */
opt3 = (optimize >= 3);
flag_predictive_commoning = opt3;
flag_inline_functions = opt3;
flag_unswitch_loops = opt3;
flag_gcse_after_reload = opt3;
flag_tree_vectorize = opt3;
flag_ipa_cp_clone = opt3;
if (flag_ipa_cp_clone)
flag_ipa_cp = 1;
and then random checks in passes:
> grep optimize\ \> *.c
tree-ssa-loop-niter.c: if (optimize >= 3)
tree-ssa-loop.c: || optimize >= 3,
true);
tree-ssa-loop.c: ret = tree_unroll_loops_completely (optimize >= 3,
false);
tree-ssa-pre.c: do_partial_partial = optimize > 2;
Thus, you can't compose -O3 from -O2 and extra flags.
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41082