diff options
author | Janus Weil <janus@gcc.gnu.org> | 2018-07-18 20:31:59 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2018-07-18 20:31:59 +0200 |
commit | 6457b1f096d216ca742f8e1f2a93462ecb24b38d (patch) | |
tree | e42854bbf767584ce4c287893b494c6154cdea1c /gcc/fortran/dump-parse-tree.c | |
parent | c56e97274f164e704e7f13dfe53531ced3cb24ca (diff) | |
download | gcc-6457b1f096d216ca742f8e1f2a93462ecb24b38d.zip gcc-6457b1f096d216ca742f8e1f2a93462ecb24b38d.tar.gz gcc-6457b1f096d216ca742f8e1f2a93462ecb24b38d.tar.bz2 |
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
Diffstat (limited to 'gcc/fortran/dump-parse-tree.c')
-rw-r--r-- | gcc/fortran/dump-parse-tree.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c index e981726..2a28fa3 100644 --- a/gcc/fortran/dump-parse-tree.c +++ b/gcc/fortran/dump-parse-tree.c @@ -716,6 +716,8 @@ show_attr (symbol_attribute *attr, const char * module) fputs (" ELEMENTAL", dumpfile); if (attr->pure) fputs (" PURE", dumpfile); + if (attr->implicit_pure) + fputs (" IMPLICIT_PURE", dumpfile); if (attr->recursive) fputs (" RECURSIVE", dumpfile); |