re PR fortran/84697 (minloc/maxloc not simplified with zero size)
authorThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 6 Mar 2018 23:50:01 +0000 (23:50 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 6 Mar 2018 23:50:01 +0000 (23:50 +0000)
commit5867bb9a60ed0ff73627180a4f2193b0087711bf
treecb4db9278ec8f7d85bef6aff9e215f7833d4b62b
parent447346e465c50ad6d840c2c29c9a07417e8d219c
re PR fortran/84697 (minloc/maxloc not simplified with zero size)

2017-03-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/84697
PR fortran/66128
* expr.c (simplify_parameter_variable): If p is a size zero array
and not an ARRAY_EXPR insert an empty array constructor and
return.
* gfortran.h: Add prototype for gfc_is_size_zero_array.
* simplify.c (is_size_zero_array): Make non-static and rename into
(gfc_is_size_zero_array):  Check for parameter arrays of zero
size by comparing shape and absence of constructor.
(gfc_simplify_all): Use gfc_is_size_zero_array instead of
is_size_zero_array.
(gfc_simplify_count): Likewise.
(gfc_simplify_iall): Likewise.
(gfc_simplify_iany): Likewise.
(gfc_simplify_iparity): Likewise.
(gfc_simplify_minval): Likewise.
(gfc_simplify_maxval): Likewise.
(gfc_simplify_product): Likewise.
(gfc_simplify_sum): Likewise.

2017-03-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/84697
PR fortran/66128
* gfortran.dg/minmaxloc_zerosize_1.f90: New test.

From-SVN: r258305
gcc/fortran/ChangeLog
gcc/fortran/expr.c
gcc/fortran/gfortran.h
gcc/fortran/simplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/minmaxloc_zerosize_1.f90 [new file with mode: 0644]