This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH 2/2] Optimize fortran loops with +-1 step.
- From: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- To: Marxin <mliska at suse dot cz>, gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Cc: hubicka at ucw dot cz, dominiq at lps dot ens dot fr, williamclodius at gmail dot com
- Date: Thu, 7 Jul 2016 17:53:51 +0200
- Subject: Re: [PATCH 2/2] Optimize fortran loops with +-1 step.
- Authentication-results: sourceware.org; auth=none
- References: <221061a76024a0014c26bd5c82069f4167e79468.1467883947.git.mliska@suse.cz> <20160707121312.GA16533@physik.fu-berlin.de>
On Thu, Jul 07, 2016 at 02:13:12PM +0200, Tobias Burnus wrote:
> marxin wrote:
> > gcc/fortran/ChangeLog:
> >
> > 2016-07-01 Martin Liska <mliska@suse.cz>
> > * lang.opt (Wundefined-do-loop): New option.
> > * resolve.c (gfc_resolve_iterator): Warn for Wundefined-do-loop.
> > (gfc_trans_simple_do): Generate a c-style loop.
> > (gfc_trans_do): Fix GNU coding style.
>
> Can you also document the new warning in gcc/fortran/invoke.texi?
>
> Otherwise, this patch looks good to me. Thanks for working on it.
If I look at the commit to .opt,
+Wundefined-do-loop
+Fortran Warning Var(warn_undefined_do_loop) LangEnabledBy(Fortran,Wall)
and to .texi,
+@item -Wundefined-do-loop
[...]
+Warn if a DO loop with step either 1 or -1 yields an underflow or an overflow
+during iteration of an induction variable of the loop. Enabled by default.
I think the "Enabled by default" is misleading as it is only enabled by -Wall,
i.e. I had expected something like: "This warning is enabled by @option{-Wall}."
Cheers,
Tobias