re PR fortran/85599 (warn about short-circuiting of logical expressions for non-pure functions)
2018-07-18 Janus Weil <janus@gcc.gnu.org>
Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/85599
* dump-parse-tree.c (show_attr): Add handling of implicit_pure.
* frontend-passes.c (do_warn_function_elimination): Do not warn for
pure functions.
* gfortran.h: Add prototypes for gfc_pure_function and
gfc_implicit_pure_function.
* gfortran.texi: Add chapter on evaluation of logical expressions.
* invoke.texi: Mention that -Wfunction-elimination is implied
by -Wextra.
* lang.opt: Make -Wextra imply -Wfunction-elimination.
* resolve.c (pure_function): Rename to gfc_pure_function.
(gfc_implicit_pure_function): New function.
(check_pure_function): Use it here.
(impure_function_callback): New function.
(resolve_operator): Call it via gfc_expr_walker.
2018-07-18 Janus Weil <janus@gcc.gnu.org>
PR fortran/85599
* gfortran.dg/function_optimize_5.f90: Add option
'-faggressive-function-elimination' and update dg-warning clauses.
* gfortran.dg/short_circuiting.f90: New test.
Co-Authored-By: Thomas Koenig <tkoenig@gcc.gnu.org>
From-SVN: r262860