summaryrefslogtreecommitdiff
path: root/gcc/fortran/invoke.texi
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2016-07-07 15:15:39 +0200
committerMartin Liska <marxin@gcc.gnu.org>2016-07-07 13:15:39 +0000
commit1c122092dcf48801c638abdf070f18c6fe025ad6 (patch)
tree22f4b1f8abca321823c347e6673350df6ccef09d /gcc/fortran/invoke.texi
parent9cc6b3f86acd4911d6cbd6f57cb3148c52e89d38 (diff)
downloadgcc-1c122092dcf48801c638abdf070f18c6fe025ad6.tar.gz
Optimize fortran loops with +-1 step.
* gfortran.dg/do_1.f90: Remove a corner case that triggers an undefined behavior. * gfortran.dg/do_3.F90: Likewise. * gfortran.dg/do_check_11.f90: New test. * gfortran.dg/do_check_12.f90: New test. * gfortran.dg/do_corner_warn.f90: New test. * 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. * invoke.texi: Mention the new warning. From-SVN: r238114
Diffstat (limited to 'gcc/fortran/invoke.texi')
-rw-r--r--gcc/fortran/invoke.texi9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index e8b8409319e..c0be1abf21f 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -764,7 +764,8 @@ This currently includes @option{-Waliasing}, @option{-Wampersand},
@option{-Wconversion}, @option{-Wsurprising}, @option{-Wc-binding-type},
@option{-Wintrinsics-std}, @option{-Wtabs}, @option{-Wintrinsic-shadow},
@option{-Wline-truncation}, @option{-Wtarget-lifetime},
-@option{-Winteger-division}, @option{-Wreal-q-constant} and @option{-Wunused}.
+@option{-Winteger-division}, @option{-Wreal-q-constant}, @option{-Wunused}
+and @option{-Wundefined-do-loop}.
@item -Waliasing
@opindex @code{Waliasing}
@@ -924,6 +925,12 @@ a warning to be issued if a tab is encountered. Note, @option{-Wtabs}
is active for @option{-pedantic}, @option{-std=f95}, @option{-std=f2003},
@option{-std=f2008}, @option{-std=f2008ts} and @option{-Wall}.
+@item -Wundefined-do-loop
+@opindex @code{Wundefined-do-loop}
+@cindex warnings, undefined 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.
+
@item -Wunderflow
@opindex @code{Wunderflow}
@cindex warnings, underflow