re PR fortran/45689 ([F03] Missing transformational intrinsic in the trans_func_f2003...
authorThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 2 Jan 2018 18:14:04 +0000 (18:14 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 2 Jan 2018 18:14:04 +0000 (18:14 +0000)
commita1d6c05238093d4de85dc18f825ba4f5e3a5746c
tree2605c1b38b5db5d39d8b02cc9db867b2106e10aa
parent0a552ae22a4b7d4a71afab9f845398597a4d230d
re PR fortran/45689 ([F03] Missing transformational intrinsic in the trans_func_f2003 list)

2017-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/45689
* intrinsic.c (add_function): Add gfc_simplify_maxloc and
gfc_simplify_minloc to maxloc and minloc, respectively.
* intrinsic.h: Add prototypes for gfc_simplify_minloc
and gfc_simplify_maxloc.
* simplify.c (min_max_chose): Adjust prototype.  Modify function
to have a return value which indicates if the extremum was found.
(is_constant_array_expr): Fix typo in comment.
(simplify_minmaxloc_to_scalar): New function.
(simplify_minmaxloc_nodim): New function.
(new_array): New function.
(simplify_minmaxloc_to_array): New function.
(gfc_simplify_minmaxloc): New function.
(simplify_minloc): New function.
(simplify_maxloc): New function.

2017-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/45689
* gfortran.dg/minloc_4.f90: New test case.
* gfortran.dg/maxloc_4.f90: New test case.

From-SVN: r256088
gcc/fortran/ChangeLog
gcc/fortran/intrinsic.c
gcc/fortran/intrinsic.h
gcc/fortran/simplify.c
gcc/testsuite/gfortran.dg/maxloc_4.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/minloc_4.f90 [new file with mode: 0644]