summaryrefslogtreecommitdiff
path: root/gcc/fortran/invoke.texi
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2018-08-10 16:08:53 +0200
committerJanus Weil <janus@gcc.gnu.org>2018-08-10 16:08:53 +0200
commitbf9197df810b0b0ac032c7e480d5a8b24c22f973 (patch)
tree11d80fa0ccfd814b4d9c2e52533951c7081beb60 /gcc/fortran/invoke.texi
parent8b9a5b5e0e1c69cd97f56c732cdb8a96c92baabe (diff)
downloadgcc-bf9197df810b0b0ac032c7e480d5a8b24c22f973.tar.gz
re PR fortran/57160 (short-circuit IF only with -ffrontend-optimize)
2018-08-10 Janus Weil <janus@gcc.gnu.org> PR fortran/57160 * invoke.texi (frontend-optimize): Mention short-circuiting. * options.c (gfc_post_options): Disable -ffrontend-optimize with -Og. * resolve.c (resolve_operator): Warn about short-circuiting only with -ffrontend-optimize. * trans-expr.c (gfc_conv_expr_op): Use short-circuiting operators only with -ffrontend-optimize. Without that flag, make sure that both operands are evaluated. 2018-08-10 Janus Weil <janus@gcc.gnu.org> PR fortran/57160 * gfortran.dg/actual_pointer_function_1.f90: Fix invalid test case. * gfortran.dg/inline_matmul_23.f90: Add option "-ffrontend-optimize". * gfortran.dg/short_circuiting_2.f90: New test case. * gfortran.dg/short_circuiting_3.f90: New test case. From-SVN: r263471
Diffstat (limited to 'gcc/fortran/invoke.texi')
-rw-r--r--gcc/fortran/invoke.texi18
1 files changed, 11 insertions, 7 deletions
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 093864b4097..ee84a0be8b1 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -1793,13 +1793,17 @@ if @option{-ffrontend-optimize} is in effect.
@opindex @code{frontend-optimize}
@cindex Front-end optimization
This option performs front-end optimization, based on manipulating
-parts the Fortran parse tree. Enabled by default by any @option{-O}
-option. Optimizations enabled by this option include inlining calls
-to @code{MATMUL}, elimination of identical function calls within
-expressions, removing unnecessary calls to @code{TRIM} in comparisons
-and assignments and replacing @code{TRIM(a)} with
-@code{a(1:LEN_TRIM(a))}. It can be deselected by specifying
-@option{-fno-frontend-optimize}.
+parts the Fortran parse tree. Enabled by default by any @option{-O} option
+except @option{-O0} and @option{-Og}. Optimizations enabled by this option
+include:
+@itemize @bullet
+@item inlining calls to @code{MATMUL},
+@item elimination of identical function calls within expressions,
+@item removing unnecessary calls to @code{TRIM} in comparisons and assignments,
+@item replacing @code{TRIM(a)} with @code{a(1:LEN_TRIM(a))} and
+@item short-circuiting of logical operators (@code{.AND.} and @code{.OR.}).
+@end itemize
+It can be deselected by specifying @option{-fno-frontend-optimize}.
@item -ffrontend-loop-interchange
@opindex @code{frontend-loop-interchange}