[2/2] libgfortran: Remove empty array descriptor first dimension overwrite [PR112371]

Message ID 20231106114325.828968-3-mikael@gcc.gnu.org
State Accepted
Headers
Series libgfortran: empty array fixes [PR112371] |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Mikael Morin Nov. 6, 2023, 11:43 a.m. UTC
  Remove the forced overwrite of the first dimension of the result array
descriptor to set it to zero extent, in the function templates for
transformational functions doing an array reduction along a dimension.  This
overwrite, which happened before early returning in case the result array
was empty, was wrong because an array may have a non-zero extent in the
first dimension and still be empty if it has a zero extent in a higher
dimension.  Overwriting the dimension was resulting in wrong array result
upper bound for the first dimension in that case.

The offending piece of code was present in several places, and this removes
them all.  More precisely, there is only one case to fix for logical
reduction functions, and there are three cases for other reduction
functions, corresponding to non-masked reduction, reduction with array mask,
and reduction with scalar mask.  The impacted m4 files are
ifunction_logical.m4 for logical reduction functions, ifunction.m4 for
regular functions and types, ifunction-s.m4 for character minloc and maxloc,
ifunction-s2.m4 for character minval and maxval, and ifindloc1.m4 for
findloc.

	PR fortran/112371

libgfortran/ChangeLog:

	* m4/ifunction.m4 (START_ARRAY_FUNCTION, START_MASKED_ARRAY_FUNCTION,
	SCALAR_ARRAY_FUNCTION): Remove overwrite of the first dimension of the
	array descriptor.
	* m4/ifunction-s.m4 (START_ARRAY_FUNCTION, START_MASKED_ARRAY_FUNCTION,
	SCALAR_ARRAY_FUNCTION): Ditto.
	* m4/ifunction-s2.m4 (START_ARRAY_FUNCTION,
	START_MASKED_ARRAY_FUNCTION, SCALAR_ARRAY_FUNCTION): Ditto.
	* m4/ifunction_logical.m4 (START_ARRAY_FUNCTION): Ditto.
	* m4/ifindloc1.m4: Ditto.
	* generated/all_l1.c: Regenerate.
	* generated/all_l16.c: Regenerate.
	* generated/all_l2.c: Regenerate.
	* generated/all_l4.c: Regenerate.
	* generated/all_l8.c: Regenerate.
	* generated/any_l1.c: Regenerate.
	* generated/any_l16.c: Regenerate.
	* generated/any_l2.c: Regenerate.
	* generated/any_l4.c: Regenerate.
	* generated/any_l8.c: Regenerate.
	* generated/count_16_l.c: Regenerate.
	* generated/count_1_l.c: Regenerate.
	* generated/count_2_l.c: Regenerate.
	* generated/count_4_l.c: Regenerate.
	* generated/count_8_l.c: Regenerate.
	* generated/findloc1_c10.c: Regenerate.
	* generated/findloc1_c16.c: Regenerate.
	* generated/findloc1_c17.c: Regenerate.
	* generated/findloc1_c4.c: Regenerate.
	* generated/findloc1_c8.c: Regenerate.
	* generated/findloc1_i1.c: Regenerate.
	* generated/findloc1_i16.c: Regenerate.
	* generated/findloc1_i2.c: Regenerate.
	* generated/findloc1_i4.c: Regenerate.
	* generated/findloc1_i8.c: Regenerate.
	* generated/findloc1_r10.c: Regenerate.
	* generated/findloc1_r16.c: Regenerate.
	* generated/findloc1_r17.c: Regenerate.
	* generated/findloc1_r4.c: Regenerate.
	* generated/findloc1_r8.c: Regenerate.
	* generated/findloc1_s1.c: Regenerate.
	* generated/findloc1_s4.c: Regenerate.
	* generated/iall_i1.c: Regenerate.
	* generated/iall_i16.c: Regenerate.
	* generated/iall_i2.c: Regenerate.
	* generated/iall_i4.c: Regenerate.
	* generated/iall_i8.c: Regenerate.
	* generated/iany_i1.c: Regenerate.
	* generated/iany_i16.c: Regenerate.
	* generated/iany_i2.c: Regenerate.
	* generated/iany_i4.c: Regenerate.
	* generated/iany_i8.c: Regenerate.
	* generated/iparity_i1.c: Regenerate.
	* generated/iparity_i16.c: Regenerate.
	* generated/iparity_i2.c: Regenerate.
	* generated/iparity_i4.c: Regenerate.
	* generated/iparity_i8.c: Regenerate.
	* generated/maxloc1_16_i1.c: Regenerate.
	* generated/maxloc1_16_i16.c: Regenerate.
	* generated/maxloc1_16_i2.c: Regenerate.
	* generated/maxloc1_16_i4.c: Regenerate.
	* generated/maxloc1_16_i8.c: Regenerate.
	* generated/maxloc1_16_r10.c: Regenerate.
	* generated/maxloc1_16_r16.c: Regenerate.
	* generated/maxloc1_16_r17.c: Regenerate.
	* generated/maxloc1_16_r4.c: Regenerate.
	* generated/maxloc1_16_r8.c: Regenerate.
	* generated/maxloc1_16_s1.c: Regenerate.
	* generated/maxloc1_16_s4.c: Regenerate.
	* generated/maxloc1_4_i1.c: Regenerate.
	* generated/maxloc1_4_i16.c: Regenerate.
	* generated/maxloc1_4_i2.c: Regenerate.
	* generated/maxloc1_4_i4.c: Regenerate.
	* generated/maxloc1_4_i8.c: Regenerate.
	* generated/maxloc1_4_r10.c: Regenerate.
	* generated/maxloc1_4_r16.c: Regenerate.
	* generated/maxloc1_4_r17.c: Regenerate.
	* generated/maxloc1_4_r4.c: Regenerate.
	* generated/maxloc1_4_r8.c: Regenerate.
	* generated/maxloc1_4_s1.c: Regenerate.
	* generated/maxloc1_4_s4.c: Regenerate.
	* generated/maxloc1_8_i1.c: Regenerate.
	* generated/maxloc1_8_i16.c: Regenerate.
	* generated/maxloc1_8_i2.c: Regenerate.
	* generated/maxloc1_8_i4.c: Regenerate.
	* generated/maxloc1_8_i8.c: Regenerate.
	* generated/maxloc1_8_r10.c: Regenerate.
	* generated/maxloc1_8_r16.c: Regenerate.
	* generated/maxloc1_8_r17.c: Regenerate.
	* generated/maxloc1_8_r4.c: Regenerate.
	* generated/maxloc1_8_r8.c: Regenerate.
	* generated/maxloc1_8_s1.c: Regenerate.
	* generated/maxloc1_8_s4.c: Regenerate.
	* generated/maxval1_s1.c: Regenerate.
	* generated/maxval1_s4.c: Regenerate.
	* generated/maxval_i1.c: Regenerate.
	* generated/maxval_i16.c: Regenerate.
	* generated/maxval_i2.c: Regenerate.
	* generated/maxval_i4.c: Regenerate.
	* generated/maxval_i8.c: Regenerate.
	* generated/maxval_r10.c: Regenerate.
	* generated/maxval_r16.c: Regenerate.
	* generated/maxval_r17.c: Regenerate.
	* generated/maxval_r4.c: Regenerate.
	* generated/maxval_r8.c: Regenerate.
	* generated/minloc1_16_i1.c: Regenerate.
	* generated/minloc1_16_i16.c: Regenerate.
	* generated/minloc1_16_i2.c: Regenerate.
	* generated/minloc1_16_i4.c: Regenerate.
	* generated/minloc1_16_i8.c: Regenerate.
	* generated/minloc1_16_r10.c: Regenerate.
	* generated/minloc1_16_r16.c: Regenerate.
	* generated/minloc1_16_r17.c: Regenerate.
	* generated/minloc1_16_r4.c: Regenerate.
	* generated/minloc1_16_r8.c: Regenerate.
	* generated/minloc1_16_s1.c: Regenerate.
	* generated/minloc1_16_s4.c: Regenerate.
	* generated/minloc1_4_i1.c: Regenerate.
	* generated/minloc1_4_i16.c: Regenerate.
	* generated/minloc1_4_i2.c: Regenerate.
	* generated/minloc1_4_i4.c: Regenerate.
	* generated/minloc1_4_i8.c: Regenerate.
	* generated/minloc1_4_r10.c: Regenerate.
	* generated/minloc1_4_r16.c: Regenerate.
	* generated/minloc1_4_r17.c: Regenerate.
	* generated/minloc1_4_r4.c: Regenerate.
	* generated/minloc1_4_r8.c: Regenerate.
	* generated/minloc1_4_s1.c: Regenerate.
	* generated/minloc1_4_s4.c: Regenerate.
	* generated/minloc1_8_i1.c: Regenerate.
	* generated/minloc1_8_i16.c: Regenerate.
	* generated/minloc1_8_i2.c: Regenerate.
	* generated/minloc1_8_i4.c: Regenerate.
	* generated/minloc1_8_i8.c: Regenerate.
	* generated/minloc1_8_r10.c: Regenerate.
	* generated/minloc1_8_r16.c: Regenerate.
	* generated/minloc1_8_r17.c: Regenerate.
	* generated/minloc1_8_r4.c: Regenerate.
	* generated/minloc1_8_r8.c: Regenerate.
	* generated/minloc1_8_s1.c: Regenerate.
	* generated/minloc1_8_s4.c: Regenerate.
	* generated/minval1_s1.c: Regenerate.
	* generated/minval1_s4.c: Regenerate.
	* generated/minval_i1.c: Regenerate.
	* generated/minval_i16.c: Regenerate.
	* generated/minval_i2.c: Regenerate.
	* generated/minval_i4.c: Regenerate.
	* generated/minval_i8.c: Regenerate.
	* generated/minval_r10.c: Regenerate.
	* generated/minval_r16.c: Regenerate.
	* generated/minval_r17.c: Regenerate.
	* generated/minval_r4.c: Regenerate.
	* generated/minval_r8.c: Regenerate.
	* generated/norm2_r10.c: Regenerate.
	* generated/norm2_r16.c: Regenerate.
	* generated/norm2_r17.c: Regenerate.
	* generated/norm2_r4.c: Regenerate.
	* generated/norm2_r8.c: Regenerate.
	* generated/parity_l1.c: Regenerate.
	* generated/parity_l16.c: Regenerate.
	* generated/parity_l2.c: Regenerate.
	* generated/parity_l4.c: Regenerate.
	* generated/parity_l8.c: Regenerate.
	* generated/product_c10.c: Regenerate.
	* generated/product_c16.c: Regenerate.
	* generated/product_c17.c: Regenerate.
	* generated/product_c4.c: Regenerate.
	* generated/product_c8.c: Regenerate.
	* generated/product_i1.c: Regenerate.
	* generated/product_i16.c: Regenerate.
	* generated/product_i2.c: Regenerate.
	* generated/product_i4.c: Regenerate.
	* generated/product_i8.c: Regenerate.
	* generated/product_r10.c: Regenerate.
	* generated/product_r16.c: Regenerate.
	* generated/product_r17.c: Regenerate.
	* generated/product_r4.c: Regenerate.
	* generated/product_r8.c: Regenerate.
	* generated/sum_c10.c: Regenerate.
	* generated/sum_c16.c: Regenerate.
	* generated/sum_c17.c: Regenerate.
	* generated/sum_c4.c: Regenerate.
	* generated/sum_c8.c: Regenerate.
	* generated/sum_i1.c: Regenerate.
	* generated/sum_i16.c: Regenerate.
	* generated/sum_i2.c: Regenerate.
	* generated/sum_i4.c: Regenerate.
	* generated/sum_i8.c: Regenerate.
	* generated/sum_r10.c: Regenerate.
	* generated/sum_r16.c: Regenerate.
	* generated/sum_r17.c: Regenerate.
	* generated/sum_r4.c: Regenerate.
	* generated/sum_r8.c: Regenerate.

gcc/testsuite/ChangeLog:

	* gfortran.dg/bound_11.f90: New test.
---
 gcc/testsuite/gfortran.dg/bound_11.f90 | 588 +++++++++++++++++++++++++
 libgfortran/generated/all_l1.c         |   6 +-
 libgfortran/generated/all_l16.c        |   6 +-
 libgfortran/generated/all_l2.c         |   6 +-
 libgfortran/generated/all_l4.c         |   6 +-
 libgfortran/generated/all_l8.c         |   6 +-
 libgfortran/generated/any_l1.c         |   6 +-
 libgfortran/generated/any_l16.c        |   6 +-
 libgfortran/generated/any_l2.c         |   6 +-
 libgfortran/generated/any_l4.c         |   6 +-
 libgfortran/generated/any_l8.c         |   6 +-
 libgfortran/generated/count_16_l.c     |   6 +-
 libgfortran/generated/count_1_l.c      |   6 +-
 libgfortran/generated/count_2_l.c      |   6 +-
 libgfortran/generated/count_4_l.c      |   6 +-
 libgfortran/generated/count_8_l.c      |   6 +-
 libgfortran/generated/findloc1_c10.c   |  18 +-
 libgfortran/generated/findloc1_c16.c   |  18 +-
 libgfortran/generated/findloc1_c17.c   |  18 +-
 libgfortran/generated/findloc1_c4.c    |  18 +-
 libgfortran/generated/findloc1_c8.c    |  18 +-
 libgfortran/generated/findloc1_i1.c    |  18 +-
 libgfortran/generated/findloc1_i16.c   |  18 +-
 libgfortran/generated/findloc1_i2.c    |  18 +-
 libgfortran/generated/findloc1_i4.c    |  18 +-
 libgfortran/generated/findloc1_i8.c    |  18 +-
 libgfortran/generated/findloc1_r10.c   |  18 +-
 libgfortran/generated/findloc1_r16.c   |  18 +-
 libgfortran/generated/findloc1_r17.c   |  18 +-
 libgfortran/generated/findloc1_r4.c    |  18 +-
 libgfortran/generated/findloc1_r8.c    |  18 +-
 libgfortran/generated/findloc1_s1.c    |  18 +-
 libgfortran/generated/findloc1_s4.c    |  18 +-
 libgfortran/generated/iall_i1.c        |  19 +-
 libgfortran/generated/iall_i16.c       |  19 +-
 libgfortran/generated/iall_i2.c        |  19 +-
 libgfortran/generated/iall_i4.c        |  19 +-
 libgfortran/generated/iall_i8.c        |  19 +-
 libgfortran/generated/iany_i1.c        |  19 +-
 libgfortran/generated/iany_i16.c       |  19 +-
 libgfortran/generated/iany_i2.c        |  19 +-
 libgfortran/generated/iany_i4.c        |  19 +-
 libgfortran/generated/iany_i8.c        |  19 +-
 libgfortran/generated/iparity_i1.c     |  19 +-
 libgfortran/generated/iparity_i16.c    |  19 +-
 libgfortran/generated/iparity_i2.c     |  19 +-
 libgfortran/generated/iparity_i4.c     |  19 +-
 libgfortran/generated/iparity_i8.c     |  19 +-
 libgfortran/generated/maxloc1_16_i1.c  |  19 +-
 libgfortran/generated/maxloc1_16_i16.c |  19 +-
 libgfortran/generated/maxloc1_16_i2.c  |  19 +-
 libgfortran/generated/maxloc1_16_i4.c  |  19 +-
 libgfortran/generated/maxloc1_16_i8.c  |  19 +-
 libgfortran/generated/maxloc1_16_r10.c |  19 +-
 libgfortran/generated/maxloc1_16_r16.c |  19 +-
 libgfortran/generated/maxloc1_16_r17.c |  19 +-
 libgfortran/generated/maxloc1_16_r4.c  |  19 +-
 libgfortran/generated/maxloc1_16_r8.c  |  19 +-
 libgfortran/generated/maxloc1_16_s1.c  |  19 +-
 libgfortran/generated/maxloc1_16_s4.c  |  19 +-
 libgfortran/generated/maxloc1_4_i1.c   |  19 +-
 libgfortran/generated/maxloc1_4_i16.c  |  19 +-
 libgfortran/generated/maxloc1_4_i2.c   |  19 +-
 libgfortran/generated/maxloc1_4_i4.c   |  19 +-
 libgfortran/generated/maxloc1_4_i8.c   |  19 +-
 libgfortran/generated/maxloc1_4_r10.c  |  19 +-
 libgfortran/generated/maxloc1_4_r16.c  |  19 +-
 libgfortran/generated/maxloc1_4_r17.c  |  19 +-
 libgfortran/generated/maxloc1_4_r4.c   |  19 +-
 libgfortran/generated/maxloc1_4_r8.c   |  19 +-
 libgfortran/generated/maxloc1_4_s1.c   |  19 +-
 libgfortran/generated/maxloc1_4_s4.c   |  19 +-
 libgfortran/generated/maxloc1_8_i1.c   |  19 +-
 libgfortran/generated/maxloc1_8_i16.c  |  19 +-
 libgfortran/generated/maxloc1_8_i2.c   |  19 +-
 libgfortran/generated/maxloc1_8_i4.c   |  19 +-
 libgfortran/generated/maxloc1_8_i8.c   |  19 +-
 libgfortran/generated/maxloc1_8_r10.c  |  19 +-
 libgfortran/generated/maxloc1_8_r16.c  |  19 +-
 libgfortran/generated/maxloc1_8_r17.c  |  19 +-
 libgfortran/generated/maxloc1_8_r4.c   |  19 +-
 libgfortran/generated/maxloc1_8_r8.c   |  19 +-
 libgfortran/generated/maxloc1_8_s1.c   |  19 +-
 libgfortran/generated/maxloc1_8_s4.c   |  19 +-
 libgfortran/generated/maxval1_s1.c     |  19 +-
 libgfortran/generated/maxval1_s4.c     |  19 +-
 libgfortran/generated/maxval_i1.c      |  19 +-
 libgfortran/generated/maxval_i16.c     |  19 +-
 libgfortran/generated/maxval_i2.c      |  19 +-
 libgfortran/generated/maxval_i4.c      |  19 +-
 libgfortran/generated/maxval_i8.c      |  19 +-
 libgfortran/generated/maxval_r10.c     |  19 +-
 libgfortran/generated/maxval_r16.c     |  19 +-
 libgfortran/generated/maxval_r17.c     |  19 +-
 libgfortran/generated/maxval_r4.c      |  19 +-
 libgfortran/generated/maxval_r8.c      |  19 +-
 libgfortran/generated/minloc1_16_i1.c  |  19 +-
 libgfortran/generated/minloc1_16_i16.c |  19 +-
 libgfortran/generated/minloc1_16_i2.c  |  19 +-
 libgfortran/generated/minloc1_16_i4.c  |  19 +-
 libgfortran/generated/minloc1_16_i8.c  |  19 +-
 libgfortran/generated/minloc1_16_r10.c |  19 +-
 libgfortran/generated/minloc1_16_r16.c |  19 +-
 libgfortran/generated/minloc1_16_r17.c |  19 +-
 libgfortran/generated/minloc1_16_r4.c  |  19 +-
 libgfortran/generated/minloc1_16_r8.c  |  19 +-
 libgfortran/generated/minloc1_16_s1.c  |  19 +-
 libgfortran/generated/minloc1_16_s4.c  |  19 +-
 libgfortran/generated/minloc1_4_i1.c   |  19 +-
 libgfortran/generated/minloc1_4_i16.c  |  19 +-
 libgfortran/generated/minloc1_4_i2.c   |  19 +-
 libgfortran/generated/minloc1_4_i4.c   |  19 +-
 libgfortran/generated/minloc1_4_i8.c   |  19 +-
 libgfortran/generated/minloc1_4_r10.c  |  19 +-
 libgfortran/generated/minloc1_4_r16.c  |  19 +-
 libgfortran/generated/minloc1_4_r17.c  |  19 +-
 libgfortran/generated/minloc1_4_r4.c   |  19 +-
 libgfortran/generated/minloc1_4_r8.c   |  19 +-
 libgfortran/generated/minloc1_4_s1.c   |  19 +-
 libgfortran/generated/minloc1_4_s4.c   |  19 +-
 libgfortran/generated/minloc1_8_i1.c   |  19 +-
 libgfortran/generated/minloc1_8_i16.c  |  19 +-
 libgfortran/generated/minloc1_8_i2.c   |  19 +-
 libgfortran/generated/minloc1_8_i4.c   |  19 +-
 libgfortran/generated/minloc1_8_i8.c   |  19 +-
 libgfortran/generated/minloc1_8_r10.c  |  19 +-
 libgfortran/generated/minloc1_8_r16.c  |  19 +-
 libgfortran/generated/minloc1_8_r17.c  |  19 +-
 libgfortran/generated/minloc1_8_r4.c   |  19 +-
 libgfortran/generated/minloc1_8_r8.c   |  19 +-
 libgfortran/generated/minloc1_8_s1.c   |  19 +-
 libgfortran/generated/minloc1_8_s4.c   |  19 +-
 libgfortran/generated/minval1_s1.c     |  19 +-
 libgfortran/generated/minval1_s4.c     |  19 +-
 libgfortran/generated/minval_i1.c      |  19 +-
 libgfortran/generated/minval_i16.c     |  19 +-
 libgfortran/generated/minval_i2.c      |  19 +-
 libgfortran/generated/minval_i4.c      |  19 +-
 libgfortran/generated/minval_i8.c      |  19 +-
 libgfortran/generated/minval_r10.c     |  19 +-
 libgfortran/generated/minval_r16.c     |  19 +-
 libgfortran/generated/minval_r17.c     |  19 +-
 libgfortran/generated/minval_r4.c      |  19 +-
 libgfortran/generated/minval_r8.c      |  19 +-
 libgfortran/generated/norm2_r10.c      |   7 +-
 libgfortran/generated/norm2_r16.c      |   7 +-
 libgfortran/generated/norm2_r17.c      |   7 +-
 libgfortran/generated/norm2_r4.c       |   7 +-
 libgfortran/generated/norm2_r8.c       |   7 +-
 libgfortran/generated/parity_l1.c      |   7 +-
 libgfortran/generated/parity_l16.c     |   7 +-
 libgfortran/generated/parity_l2.c      |   7 +-
 libgfortran/generated/parity_l4.c      |   7 +-
 libgfortran/generated/parity_l8.c      |   7 +-
 libgfortran/generated/product_c10.c    |  19 +-
 libgfortran/generated/product_c16.c    |  19 +-
 libgfortran/generated/product_c17.c    |  19 +-
 libgfortran/generated/product_c4.c     |  19 +-
 libgfortran/generated/product_c8.c     |  19 +-
 libgfortran/generated/product_i1.c     |  19 +-
 libgfortran/generated/product_i16.c    |  19 +-
 libgfortran/generated/product_i2.c     |  19 +-
 libgfortran/generated/product_i4.c     |  19 +-
 libgfortran/generated/product_i8.c     |  19 +-
 libgfortran/generated/product_r10.c    |  19 +-
 libgfortran/generated/product_r16.c    |  19 +-
 libgfortran/generated/product_r17.c    |  19 +-
 libgfortran/generated/product_r4.c     |  19 +-
 libgfortran/generated/product_r8.c     |  19 +-
 libgfortran/generated/sum_c10.c        |  19 +-
 libgfortran/generated/sum_c16.c        |  19 +-
 libgfortran/generated/sum_c17.c        |  19 +-
 libgfortran/generated/sum_c4.c         |  19 +-
 libgfortran/generated/sum_c8.c         |  19 +-
 libgfortran/generated/sum_i1.c         |  19 +-
 libgfortran/generated/sum_i16.c        |  19 +-
 libgfortran/generated/sum_i2.c         |  19 +-
 libgfortran/generated/sum_i4.c         |  19 +-
 libgfortran/generated/sum_i8.c         |  19 +-
 libgfortran/generated/sum_r10.c        |  19 +-
 libgfortran/generated/sum_r16.c        |  19 +-
 libgfortran/generated/sum_r17.c        |  19 +-
 libgfortran/generated/sum_r4.c         |  19 +-
 libgfortran/generated/sum_r8.c         |  19 +-
 libgfortran/m4/ifindloc1.m4            |  18 +-
 libgfortran/m4/ifunction-s.m4          |  19 +-
 libgfortran/m4/ifunction-s2.m4         |  19 +-
 libgfortran/m4/ifunction.m4            |  19 +-
 libgfortran/m4/ifunction_logical.m4    |   6 +-
 189 files changed, 1100 insertions(+), 2714 deletions(-)
 create mode 100644 gcc/testsuite/gfortran.dg/bound_11.f90
  

Comments

Harald Anlauf Nov. 6, 2023, 6:20 p.m. UTC | #1
Hi Mikael,

Am 06.11.23 um 12:43 schrieb Mikael Morin:
> Remove the forced overwrite of the first dimension of the result array
> descriptor to set it to zero extent, in the function templates for
> transformational functions doing an array reduction along a dimension.  This
> overwrite, which happened before early returning in case the result array
> was empty, was wrong because an array may have a non-zero extent in the
> first dimension and still be empty if it has a zero extent in a higher
> dimension.  Overwriting the dimension was resulting in wrong array result
> upper bound for the first dimension in that case.
> 
> The offending piece of code was present in several places, and this removes
> them all.  More precisely, there is only one case to fix for logical
> reduction functions, and there are three cases for other reduction
> functions, corresponding to non-masked reduction, reduction with array mask,
> and reduction with scalar mask.  The impacted m4 files are
> ifunction_logical.m4 for logical reduction functions, ifunction.m4 for
> regular functions and types, ifunction-s.m4 for character minloc and maxloc,
> ifunction-s2.m4 for character minval and maxval, and ifindloc1.m4 for
> findloc.

while your fix seems mechanical and correct, I wonder if you looked
at the following pre-existing irregularity which can be seen in
this snippet:

> diff --git a/libgfortran/m4/ifunction.m4 b/libgfortran/m4/ifunction.m4
> index 480649cf691..abc15b430ab 100644
> --- a/libgfortran/m4/ifunction.m4
> +++ b/libgfortran/m4/ifunction.m4
> @@ -96,12 +96,7 @@ name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray,
>   
>         retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
>         if (alloc_size == 0)
> -	{
> -	  /* Make sure we have a zero-sized array.  */
> -	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
> -	  return;
> -
> -	}
> +	return;
>       }
>     else
>       {

This is all enclosed in a block which has
   if (retarray->base_addr == NULL)
but allocates and sets retarray->base_addr, while

> @@ -290,11 +285,7 @@ m'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray,
>         retarray->dtype.rank = rank;
>   
>         if (alloc_size == 0)
> -	{
> -	  /* Make sure we have a zero-sized array.  */
> -	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
> -	  return;
> -	}
> +	return;
>         else
>   	retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
>   

and

> @@ -454,11 +445,7 @@ void
>         alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
>   
>         if (alloc_size == 0)
> -	{
> -	  /* Make sure we have a zero-sized array.  */
> -	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
> -	  return;
> -	}
> +	return;
>         else
>   	retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
>       }

do not set retarray->base_addr to non-NULL for alloc_size == 0.

Do you know if the first snippet can be safely rewritten to avoid
the (hopefully pointless) xmallocarray for alloc_size == 0?

Thanks,
Harald
  
Mikael Morin Nov. 6, 2023, 7:19 p.m. UTC | #2
Le 06/11/2023 à 19:20, Harald Anlauf a écrit :
> Hi Mikael,
> 
> Am 06.11.23 um 12:43 schrieb Mikael Morin:
>> Remove the forced overwrite of the first dimension of the result array
>> descriptor to set it to zero extent, in the function templates for
>> transformational functions doing an array reduction along a 
>> dimension.  This
>> overwrite, which happened before early returning in case the result array
>> was empty, was wrong because an array may have a non-zero extent in the
>> first dimension and still be empty if it has a zero extent in a higher
>> dimension.  Overwriting the dimension was resulting in wrong array result
>> upper bound for the first dimension in that case.
>>
>> The offending piece of code was present in several places, and this 
>> removes
>> them all.  More precisely, there is only one case to fix for logical
>> reduction functions, and there are three cases for other reduction
>> functions, corresponding to non-masked reduction, reduction with array 
>> mask,
>> and reduction with scalar mask.  The impacted m4 files are
>> ifunction_logical.m4 for logical reduction functions, ifunction.m4 for
>> regular functions and types, ifunction-s.m4 for character minloc and 
>> maxloc,
>> ifunction-s2.m4 for character minval and maxval, and ifindloc1.m4 for
>> findloc.
> 
> while your fix seems mechanical and correct, I wonder if you looked
> at the following pre-existing irregularity which can be seen in
> this snippet:
> 
>> diff --git a/libgfortran/m4/ifunction.m4 b/libgfortran/m4/ifunction.m4
>> index 480649cf691..abc15b430ab 100644
>> --- a/libgfortran/m4/ifunction.m4
>> +++ b/libgfortran/m4/ifunction.m4
>> @@ -96,12 +96,7 @@ name`'rtype_qual`_'atype_code` ('rtype` * const 
>> restrict retarray,
>>
>>         retarray->base_addr = xmallocarray (alloc_size, sizeof 
>> (rtype_name));
>>         if (alloc_size == 0)
>> -    {
>> -      /* Make sure we have a zero-sized array.  */
>> -      GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
>> -      return;
>> -
>> -    }
>> +    return;
>>       }
>>     else
>>       {
> 
> This is all enclosed in a block which has
>    if (retarray->base_addr == NULL)
> but allocates and sets retarray->base_addr, while
> 
>> @@ -290,11 +285,7 @@ m'name`'rtype_qual`_'atype_code` ('rtype` * const 
>> restrict retarray,
>>         retarray->dtype.rank = rank;
>>
>>         if (alloc_size == 0)
>> -    {
>> -      /* Make sure we have a zero-sized array.  */
>> -      GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
>> -      return;
>> -    }
>> +    return;
>>         else
>>       retarray->base_addr = xmallocarray (alloc_size, sizeof 
>> (rtype_name));
>>
> 
> and
> 
>> @@ -454,11 +445,7 @@ void
>>         alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * 
>> extent[rank-1];
>>
>>         if (alloc_size == 0)
>> -    {
>> -      /* Make sure we have a zero-sized array.  */
>> -      GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
>> -      return;
>> -    }
>> +    return;
>>         else
>>       retarray->base_addr = xmallocarray (alloc_size, sizeof 
>> (rtype_name));
>>       }
> 
> do not set retarray->base_addr to non-NULL for alloc_size == 0.
> 
> Do you know if the first snippet can be safely rewritten to avoid
> the (hopefully pointless) xmallocarray for alloc_size == 0?
> 

This change to the testcase:

diff --git a/gcc/testsuite/gfortran.dg/bound_11.f90 
b/gcc/testsuite/gfortran.dg/bound_11.f90
index 170eba4ddfd..2e96f843476 100644
--- a/gcc/testsuite/gfortran.dg/bound_11.f90
+++ b/gcc/testsuite/gfortran.dg/bound_11.f90
@@ -88,6 +88,7 @@ contains
      m4 = .false.
      i = 1
      r = sum(a, dim=i)
+    if (.not. allocated(r)) stop 210
      if (any(shape(r) /= (/ 3, 0, 7 /))) stop 211
      if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 212
      i = 2
@@ -104,6 +105,7 @@ contains
      if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 218
      i = 1
      r = sum(a, dim=i, mask=m1)
+    if (.not. allocated(r)) stop 220
      if (any(shape(r) /= (/ 3, 0, 7 /))) stop 221
      if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 222
      i = 2
@@ -120,6 +122,7 @@ contains
      if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 228
      i = 1
      r = sum(a, dim=i, mask=m4)
+    if (.not. allocated(r)) stop 230
      if (any(shape(r) /= (/ 3, 0, 7 /))) stop 231
      if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 232
      i = 2

gives me a FAIL with STOP 220 (or STOP 230 if the STOP 220 line is 
commented); the first one with STOP 210 passes.
So it is the first snippet with the xmallocarray (which supports zero 
values see memory.c) call that is the correct one.
Good catch, I will open a separate PR.

Mikael
  
Harald Anlauf Nov. 6, 2023, 8:03 p.m. UTC | #3
Hi Mikael,

Am 06.11.23 um 20:19 schrieb Mikael Morin:
> 
> This change to the testcase:
> 
> diff --git a/gcc/testsuite/gfortran.dg/bound_11.f90 
> b/gcc/testsuite/gfortran.dg/bound_11.f90
> index 170eba4ddfd..2e96f843476 100644
> --- a/gcc/testsuite/gfortran.dg/bound_11.f90
> +++ b/gcc/testsuite/gfortran.dg/bound_11.f90
> @@ -88,6 +88,7 @@ contains
>       m4 = .false.
>       i = 1
>       r = sum(a, dim=i)
> +    if (.not. allocated(r)) stop 210
>       if (any(shape(r) /= (/ 3, 0, 7 /))) stop 211
>       if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 212
>       i = 2
> @@ -104,6 +105,7 @@ contains
>       if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 218
>       i = 1
>       r = sum(a, dim=i, mask=m1)
> +    if (.not. allocated(r)) stop 220
>       if (any(shape(r) /= (/ 3, 0, 7 /))) stop 221
>       if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 222
>       i = 2
> @@ -120,6 +122,7 @@ contains
>       if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 228
>       i = 1
>       r = sum(a, dim=i, mask=m4)
> +    if (.not. allocated(r)) stop 230
>       if (any(shape(r) /= (/ 3, 0, 7 /))) stop 231
>       if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 232
>       i = 2
> 
> gives me a FAIL with STOP 220 (or STOP 230 if the STOP 220 line is 
> commented); the first one with STOP 210 passes.
> So it is the first snippet with the xmallocarray (which supports zero 
> values see memory.c) call that is the correct one.
> Good catch, I will open a separate PR.

ah, now I see that the case of allocation of zero elements
always allocates one byte, which is needed for r.data to be
non-null.

Go ahead!

Harald


> Mikael
>
  

Patch

diff --git a/gcc/testsuite/gfortran.dg/bound_11.f90 b/gcc/testsuite/gfortran.dg/bound_11.f90
new file mode 100644
index 00000000000..170eba4ddfd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/bound_11.f90
@@ -0,0 +1,588 @@ 
+! { dg-do run }
+!
+! PR fortran/112371
+! The library used to incorrectly set an extent of zero for the first
+! dimension of the resulting array of a reduction function if that array was
+! empty.
+
+program p
+  implicit none
+  call check_iparity
+  call check_sum
+  call check_minloc_int
+  call check_minloc_char
+  call check_maxloc_char4
+  call check_minval_char
+  call check_maxval_char4
+  call check_any
+  call check_count4
+  call check_findloc_int
+  call check_findloc_char
+contains
+  subroutine check_iparity
+    integer :: a(9,3,0,7)
+    logical :: m1(9,3,0,7)
+    logical(kind=4) :: m4
+    integer :: i
+    integer, allocatable :: r(:,:,:)
+    a  = reshape((/ integer:: /), shape(a))
+    m1 = reshape((/ logical:: /), shape(m1))
+    m4 = .false.
+    i = 1
+    r = iparity(a, dim=i)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 111
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 112
+    i = 2
+    r = iparity(a, dim=i)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 113
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 114
+    i = 3
+    r = iparity(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 115
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 116
+    i = 4
+    r = iparity(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 117
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 118
+    i = 1
+    r = iparity(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 121
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 122
+    i = 2
+    r = iparity(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 123
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 124
+    i = 3
+    r = iparity(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 125
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 126
+    i = 4
+    r = iparity(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 127
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 128
+    i = 1
+    r = iparity(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 131
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 132
+    i = 2
+    r = iparity(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 133
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 134
+    i = 3
+    r = iparity(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 135
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 136
+    i = 4
+    r = iparity(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 137
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 138
+  end subroutine
+  subroutine check_sum
+    integer :: a(9,3,0,7)
+    logical :: m1(9,3,0,7)
+    logical(kind=4) :: m4
+    integer :: i
+    integer, allocatable :: r(:,:,:)
+    a  = reshape((/ integer:: /), shape(a))
+    m1 = reshape((/ logical:: /), shape(m1))
+    m4 = .false.
+    i = 1
+    r = sum(a, dim=i)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 211
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 212
+    i = 2
+    r = sum(a, dim=i)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 213
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 214
+    i = 3
+    r = sum(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 215
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 216
+    i = 4
+    r = sum(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 217
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 218
+    i = 1
+    r = sum(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 221
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 222
+    i = 2
+    r = sum(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 223
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 224
+    i = 3
+    r = sum(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 225
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 226
+    i = 4
+    r = sum(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 227
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 228
+    i = 1
+    r = sum(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 231
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 232
+    i = 2
+    r = sum(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 233
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 234
+    i = 3
+    r = sum(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 235
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 236
+    i = 4
+    r = sum(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 237
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 238
+  end subroutine
+  subroutine check_minloc_int
+    integer :: a(9,3,0,7)
+    logical :: m1(9,3,0,7)
+    logical(kind=4) :: m4
+    integer :: i
+    integer, allocatable :: r(:,:,:)
+    a  = reshape((/ integer:: /), shape(a))
+    m1 = reshape((/ logical:: /), shape(m1))
+    m4 = .false.
+    i = 1
+    r = minloc(a, dim=i)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 311
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 312
+    i = 2
+    r = minloc(a, dim=i)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 313
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 314
+    i = 3
+    r = minloc(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 315
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 316
+    i = 4
+    r = minloc(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 317
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 318
+    i = 1
+    r = minloc(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 321
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 322
+    i = 2
+    r = minloc(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 323
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 324
+    i = 3
+    r = minloc(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 325
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 326
+    i = 4
+    r = minloc(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 327
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 328
+    i = 1
+    r = minloc(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 331
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 332
+    i = 2
+    r = minloc(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 333
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 334
+    i = 3
+    r = minloc(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 335
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 336
+    i = 4
+    r = minloc(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 337
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 338
+  end subroutine
+  subroutine check_minloc_char
+    character :: a(9,3,0,7)
+    logical :: m1(9,3,0,7)
+    logical(kind=4) :: m4
+    integer :: i
+    integer, allocatable :: r(:,:,:)
+    a  = reshape((/ character:: /), shape(a))
+    m1 = reshape((/ logical:: /), shape(m1))
+    m4 = .false.
+    i = 1
+    r = minloc(a, dim=i)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 411
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 412
+    i = 2
+    r = minloc(a, dim=i)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 413
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 414
+    i = 3
+    r = minloc(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 415
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 416
+    i = 4
+    r = minloc(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 417
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 418
+    i = 1
+    r = minloc(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 421
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 422
+    i = 2
+    r = minloc(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 423
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 424
+    i = 3
+    r = minloc(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 425
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 426
+    i = 4
+    r = minloc(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 427
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 428
+    i = 1
+    r = minloc(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 431
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 432
+    i = 2
+    r = minloc(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 433
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 434
+    i = 3
+    r = minloc(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 435
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 436
+    i = 4
+    r = minloc(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 437
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 438
+  end subroutine
+  subroutine check_maxloc_char4
+    character(kind=4) :: a(9,3,0,7)
+    logical :: m1(9,3,0,7)
+    logical(kind=4) :: m4
+    integer :: i
+    integer, allocatable :: r(:,:,:)
+    a  = reshape((/ character(kind=4):: /), shape(a))
+    m1 = reshape((/ logical:: /), shape(m1))
+    m4 = .false.
+    i = 1
+    r = maxloc(a, dim=i)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 511
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 512
+    i = 2
+    r = maxloc(a, dim=i)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 513
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 514
+    i = 3
+    r = maxloc(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 515
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 516
+    i = 4
+    r = maxloc(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 517
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 518
+    i = 1
+    r = maxloc(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 521
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 522
+    i = 2
+    r = maxloc(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 523
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 524
+    i = 3
+    r = maxloc(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 525
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 526
+    i = 4
+    r = maxloc(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 527
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 528
+    i = 1
+    r = maxloc(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 531
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 532
+    i = 2
+    r = maxloc(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 533
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 534
+    i = 3
+    r = maxloc(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 535
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 536
+    i = 4
+    r = maxloc(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 537
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 538
+  end subroutine
+  subroutine check_minval_char
+    character :: a(9,3,0,7)
+    logical :: m1(9,3,0,7)
+    logical(kind=4) :: m4
+    integer :: i
+    character, allocatable :: r(:,:,:)
+    a  = reshape((/ character:: /), shape(a))
+    m1 = reshape((/ logical:: /), shape(m1))
+    m4 = .false.
+    i = 1
+    r = minval(a, dim=i)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 611
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 612
+    i = 2
+    r = minval(a, dim=i)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 613
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 614
+    i = 3
+    r = minval(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 615
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 616
+    i = 4
+    r = minval(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 617
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 618
+    i = 1
+    r = minval(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 621
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 622
+    i = 2
+    r = minval(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 623
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 624
+    i = 3
+    r = minval(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 625
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 626
+    i = 4
+    r = minval(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 627
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 628
+    i = 1
+    r = minval(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 631
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 632
+    i = 2
+    r = minval(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 633
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 634
+    i = 3
+    r = minval(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 635
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 636
+    i = 4
+    r = minval(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 637
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 638
+  end subroutine
+  subroutine check_maxval_char4
+    character(kind=4) :: a(9,3,0,7)
+    logical :: m1(9,3,0,7)
+    logical(kind=4) :: m4
+    integer :: i
+    character(kind=4), allocatable :: r(:,:,:)
+    a  = reshape((/ character(kind=4):: /), shape(a))
+    m1 = reshape((/ logical:: /), shape(m1))
+    m4 = .false.
+    i = 1
+    r = maxval(a, dim=i)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 711
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 712
+    i = 2
+    r = maxval(a, dim=i)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 713
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 714
+    i = 3
+    r = maxval(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 715
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 716
+    i = 4
+    r = maxval(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 717
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 718
+    i = 1
+    r = maxval(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 721
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 722
+    i = 2
+    r = maxval(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 723
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 724
+    i = 3
+    r = maxval(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 725
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 726
+    i = 4
+    r = maxval(a, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 727
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 728
+    i = 1
+    r = maxval(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 731
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 732
+    i = 2
+    r = maxval(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 733
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 734
+    i = 3
+    r = maxval(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 735
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 736
+    i = 4
+    r = maxval(a, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 737
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 738
+  end subroutine
+  subroutine check_any
+    logical :: a(9,3,0,7)
+    integer :: i
+    logical, allocatable :: r(:,:,:)
+    a  = reshape((/ logical:: /), shape(a))
+    i = 1
+    r = any(a, dim=i)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 811
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 812
+    i = 2
+    r = any(a, dim=i)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 813
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 814
+    i = 3
+    r = any(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 815
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 816
+    i = 4
+    r = any(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 817
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 818
+  end subroutine
+  subroutine check_count4
+    logical(kind=4) :: a(9,3,0,7)
+    integer :: i
+    integer, allocatable :: r(:,:,:)
+    a  = reshape((/ logical(kind=4):: /), shape(a))
+    i = 1
+    r = count(a, dim=i)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 911
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 912
+    i = 2
+    r = count(a, dim=i)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 913
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 914
+    i = 3
+    r = count(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 915
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 916
+    i = 4
+    r = count(a, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 917
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 918
+  end subroutine
+  subroutine check_findloc_int
+    integer :: a(9,3,0,7)
+    logical :: m1(9,3,0,7)
+    logical(kind=4) :: m4
+    integer :: i
+    integer, allocatable :: r(:,:,:)
+    a  = reshape((/ integer:: /), shape(a))
+    m1 = reshape((/ logical:: /), shape(m1))
+    m4 = .false.
+    i = 1
+    r = findloc(a, 10, dim=i)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 1011
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 1012
+    i = 2
+    r = findloc(a, 10, dim=i)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 1013
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 1014
+    i = 3
+    r = findloc(a, 10, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 1015
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 1016
+    i = 4
+    r = findloc(a, 10, dim=i)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 1017
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 1018
+    i = 1
+    r = findloc(a, 10, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 1021
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 1022
+    i = 2
+    r = findloc(a, 10, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 1023
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 1024
+    i = 3
+    r = findloc(a, 10, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 1025
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 1026
+    i = 4
+    r = findloc(a, 10, dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 1027
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 1028
+    i = 1
+    r = findloc(a, 10, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 1031
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 1032
+    i = 2
+    r = findloc(a, 10, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 1033
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 1034
+    i = 3
+    r = findloc(a, 10, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 1035
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 1036
+    i = 4
+    r = findloc(a, 10, dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 1037
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 1038
+  end subroutine
+  subroutine check_findloc_char
+    character :: a(9,3,0,7)
+    logical :: m1(9,3,0,7)
+    logical(kind=4) :: m4
+    integer :: i
+    integer, allocatable :: r(:,:,:)
+    a  = reshape((/ character:: /), shape(a))
+    m1 = reshape((/ logical:: /), shape(m1))
+    m4 = .false.
+    i = 1
+    r = findloc(a, "a", dim=i)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 1111
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 1112
+    i = 2
+    r = findloc(a, "a", dim=i)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 1113
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 1114
+    i = 3
+    r = findloc(a, "a", dim=i)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 1115
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 1116
+    i = 4
+    r = findloc(a, "a", dim=i)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 1117
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 1118
+    i = 1
+    r = findloc(a, "a", dim=i, mask=m1)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 1121
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 1122
+    i = 2
+    r = findloc(a, "a", dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 1123
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 1124
+    i = 3
+    r = findloc(a, "a", dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 1125
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 1126
+    i = 4
+    r = findloc(a, "a", dim=i, mask=m1)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 1127
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 1128
+    i = 1
+    r = findloc(a, "a", dim=i, mask=m4)
+    if (any(shape(r) /= (/ 3, 0, 7 /))) stop 1131
+    if (any(ubound(r) /= (/ 3, 0, 7 /))) stop 1132
+    i = 2
+    r = findloc(a, "a", dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 0, 7 /))) stop 1133
+    if (any(ubound(r) /= (/ 9, 0, 7 /))) stop 1134
+    i = 3
+    r = findloc(a, "a", dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 7 /))) stop 1135
+    if (any(ubound(r) /= (/ 9, 3, 7 /))) stop 1136
+    i = 4
+    r = findloc(a, "a", dim=i, mask=m4)
+    if (any(shape(r) /= (/ 9, 3, 0 /))) stop 1137
+    if (any(ubound(r) /= (/ 9, 3, 0 /))) stop 1138
+  end subroutine
+end program
diff --git a/libgfortran/generated/all_l1.c b/libgfortran/generated/all_l1.c
index afe94491b42..dee2d643d7a 100644
--- a/libgfortran/generated/all_l1.c
+++ b/libgfortran/generated/all_l1.c
@@ -102,11 +102,7 @@  all_l1 (gfc_array_l1 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
     }
diff --git a/libgfortran/generated/all_l16.c b/libgfortran/generated/all_l16.c
index 3b04889f920..4898899a621 100644
--- a/libgfortran/generated/all_l16.c
+++ b/libgfortran/generated/all_l16.c
@@ -102,11 +102,7 @@  all_l16 (gfc_array_l16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
     }
diff --git a/libgfortran/generated/all_l2.c b/libgfortran/generated/all_l2.c
index 5ce9027d6f5..9bf0c2a74e9 100644
--- a/libgfortran/generated/all_l2.c
+++ b/libgfortran/generated/all_l2.c
@@ -102,11 +102,7 @@  all_l2 (gfc_array_l2 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
     }
diff --git a/libgfortran/generated/all_l4.c b/libgfortran/generated/all_l4.c
index e004d1f6783..bef696f6ef4 100644
--- a/libgfortran/generated/all_l4.c
+++ b/libgfortran/generated/all_l4.c
@@ -102,11 +102,7 @@  all_l4 (gfc_array_l4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
     }
diff --git a/libgfortran/generated/all_l8.c b/libgfortran/generated/all_l8.c
index 7ae7392d4bf..dac8ee71392 100644
--- a/libgfortran/generated/all_l8.c
+++ b/libgfortran/generated/all_l8.c
@@ -102,11 +102,7 @@  all_l8 (gfc_array_l8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
     }
diff --git a/libgfortran/generated/any_l1.c b/libgfortran/generated/any_l1.c
index f3269c6c920..ea26225cce2 100644
--- a/libgfortran/generated/any_l1.c
+++ b/libgfortran/generated/any_l1.c
@@ -102,11 +102,7 @@  any_l1 (gfc_array_l1 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
     }
diff --git a/libgfortran/generated/any_l16.c b/libgfortran/generated/any_l16.c
index d27f496e93c..a8c5d71f341 100644
--- a/libgfortran/generated/any_l16.c
+++ b/libgfortran/generated/any_l16.c
@@ -102,11 +102,7 @@  any_l16 (gfc_array_l16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
     }
diff --git a/libgfortran/generated/any_l2.c b/libgfortran/generated/any_l2.c
index bac6837f515..2e0a123c5e4 100644
--- a/libgfortran/generated/any_l2.c
+++ b/libgfortran/generated/any_l2.c
@@ -102,11 +102,7 @@  any_l2 (gfc_array_l2 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
     }
diff --git a/libgfortran/generated/any_l4.c b/libgfortran/generated/any_l4.c
index f489091774d..25b6f17c6ab 100644
--- a/libgfortran/generated/any_l4.c
+++ b/libgfortran/generated/any_l4.c
@@ -102,11 +102,7 @@  any_l4 (gfc_array_l4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
     }
diff --git a/libgfortran/generated/any_l8.c b/libgfortran/generated/any_l8.c
index a22923c0c61..1c2838e110f 100644
--- a/libgfortran/generated/any_l8.c
+++ b/libgfortran/generated/any_l8.c
@@ -102,11 +102,7 @@  any_l8 (gfc_array_l8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
     }
diff --git a/libgfortran/generated/count_16_l.c b/libgfortran/generated/count_16_l.c
index 545ce6537bf..ddcca9d7385 100644
--- a/libgfortran/generated/count_16_l.c
+++ b/libgfortran/generated/count_16_l.c
@@ -102,11 +102,7 @@  count_16_l (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/count_1_l.c b/libgfortran/generated/count_1_l.c
index fd95964534f..046e91dfa5c 100644
--- a/libgfortran/generated/count_1_l.c
+++ b/libgfortran/generated/count_1_l.c
@@ -102,11 +102,7 @@  count_1_l (gfc_array_i1 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
     }
diff --git a/libgfortran/generated/count_2_l.c b/libgfortran/generated/count_2_l.c
index 63512580e61..78a4fbf776c 100644
--- a/libgfortran/generated/count_2_l.c
+++ b/libgfortran/generated/count_2_l.c
@@ -102,11 +102,7 @@  count_2_l (gfc_array_i2 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
     }
diff --git a/libgfortran/generated/count_4_l.c b/libgfortran/generated/count_4_l.c
index 44e7d68b2a4..a5aef43b3a6 100644
--- a/libgfortran/generated/count_4_l.c
+++ b/libgfortran/generated/count_4_l.c
@@ -102,11 +102,7 @@  count_4_l (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/count_8_l.c b/libgfortran/generated/count_8_l.c
index 4f4d82b5d62..a4533b62440 100644
--- a/libgfortran/generated/count_8_l.c
+++ b/libgfortran/generated/count_8_l.c
@@ -102,11 +102,7 @@  count_8_l (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/findloc1_c10.c b/libgfortran/generated/findloc1_c10.c
index 0b7905a101c..fa68971ff38 100644
--- a/libgfortran/generated/findloc1_c10.c
+++ b/libgfortran/generated/findloc1_c10.c
@@ -105,11 +105,7 @@  findloc1_c10 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_c10 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_c10 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_c16.c b/libgfortran/generated/findloc1_c16.c
index 1cbe1fc5b26..13e2209dc32 100644
--- a/libgfortran/generated/findloc1_c16.c
+++ b/libgfortran/generated/findloc1_c16.c
@@ -105,11 +105,7 @@  findloc1_c16 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_c16 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_c16 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_c17.c b/libgfortran/generated/findloc1_c17.c
index fea16286bf8..03c651e9c19 100644
--- a/libgfortran/generated/findloc1_c17.c
+++ b/libgfortran/generated/findloc1_c17.c
@@ -105,11 +105,7 @@  findloc1_c17 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_c17 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_c17 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_c4.c b/libgfortran/generated/findloc1_c4.c
index 2c800aa4a77..6c3fe7cd537 100644
--- a/libgfortran/generated/findloc1_c4.c
+++ b/libgfortran/generated/findloc1_c4.c
@@ -105,11 +105,7 @@  findloc1_c4 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_c4 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_c4 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_c8.c b/libgfortran/generated/findloc1_c8.c
index 9f14e631c9e..2b4b84b522c 100644
--- a/libgfortran/generated/findloc1_c8.c
+++ b/libgfortran/generated/findloc1_c8.c
@@ -105,11 +105,7 @@  findloc1_c8 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_c8 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_c8 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_i1.c b/libgfortran/generated/findloc1_i1.c
index 90896ac92a6..5175198a295 100644
--- a/libgfortran/generated/findloc1_i1.c
+++ b/libgfortran/generated/findloc1_i1.c
@@ -105,11 +105,7 @@  findloc1_i1 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_i1 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_i1 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_i16.c b/libgfortran/generated/findloc1_i16.c
index 699320dffcd..c3fcf8b5a2c 100644
--- a/libgfortran/generated/findloc1_i16.c
+++ b/libgfortran/generated/findloc1_i16.c
@@ -105,11 +105,7 @@  findloc1_i16 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_i16 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_i16 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_i2.c b/libgfortran/generated/findloc1_i2.c
index d3ebdab8f23..c00f7b5c244 100644
--- a/libgfortran/generated/findloc1_i2.c
+++ b/libgfortran/generated/findloc1_i2.c
@@ -105,11 +105,7 @@  findloc1_i2 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_i2 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_i2 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_i4.c b/libgfortran/generated/findloc1_i4.c
index e030e6bee60..d1d0247b656 100644
--- a/libgfortran/generated/findloc1_i4.c
+++ b/libgfortran/generated/findloc1_i4.c
@@ -105,11 +105,7 @@  findloc1_i4 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_i4 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_i4 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_i8.c b/libgfortran/generated/findloc1_i8.c
index 678e6516105..02f219bcc1e 100644
--- a/libgfortran/generated/findloc1_i8.c
+++ b/libgfortran/generated/findloc1_i8.c
@@ -105,11 +105,7 @@  findloc1_i8 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_i8 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_i8 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_r10.c b/libgfortran/generated/findloc1_r10.c
index b416fdd0e00..1b824c7d78b 100644
--- a/libgfortran/generated/findloc1_r10.c
+++ b/libgfortran/generated/findloc1_r10.c
@@ -105,11 +105,7 @@  findloc1_r10 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_r10 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_r10 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_r16.c b/libgfortran/generated/findloc1_r16.c
index d03b34fbc0b..9a42849c989 100644
--- a/libgfortran/generated/findloc1_r16.c
+++ b/libgfortran/generated/findloc1_r16.c
@@ -105,11 +105,7 @@  findloc1_r16 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_r16 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_r16 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_r17.c b/libgfortran/generated/findloc1_r17.c
index 2b72e90506a..7b95da2b6e7 100644
--- a/libgfortran/generated/findloc1_r17.c
+++ b/libgfortran/generated/findloc1_r17.c
@@ -105,11 +105,7 @@  findloc1_r17 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_r17 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_r17 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_r4.c b/libgfortran/generated/findloc1_r4.c
index fa216cca481..8b527728cb0 100644
--- a/libgfortran/generated/findloc1_r4.c
+++ b/libgfortran/generated/findloc1_r4.c
@@ -105,11 +105,7 @@  findloc1_r4 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_r4 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_r4 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_r8.c b/libgfortran/generated/findloc1_r8.c
index 7f1e044f8e1..0ac3fd6e73a 100644
--- a/libgfortran/generated/findloc1_r8.c
+++ b/libgfortran/generated/findloc1_r8.c
@@ -105,11 +105,7 @@  findloc1_r8 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -293,11 +289,7 @@  mfindloc1_r8 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -466,11 +458,7 @@  sfindloc1_r8 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_s1.c b/libgfortran/generated/findloc1_s1.c
index 2fb81c414af..85b13bd7c5f 100644
--- a/libgfortran/generated/findloc1_s1.c
+++ b/libgfortran/generated/findloc1_s1.c
@@ -107,11 +107,7 @@  findloc1_s1 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -295,11 +291,7 @@  mfindloc1_s1 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -468,11 +460,7 @@  sfindloc1_s1 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/findloc1_s4.c b/libgfortran/generated/findloc1_s4.c
index 641ca7fa58a..7b5a020d314 100644
--- a/libgfortran/generated/findloc1_s4.c
+++ b/libgfortran/generated/findloc1_s4.c
@@ -107,11 +107,7 @@  findloc1_s4 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -295,11 +291,7 @@  mfindloc1_s4 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -468,11 +460,7 @@  sfindloc1_s4 (gfc_array_index_type * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/iall_i1.c b/libgfortran/generated/iall_i1.c
index 44ccbce270a..335eec824bc 100644
--- a/libgfortran/generated/iall_i1.c
+++ b/libgfortran/generated/iall_i1.c
@@ -106,12 +106,7 @@  iall_i1 (gfc_array_i1 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miall_i1 (gfc_array_i1 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
@@ -465,11 +456,7 @@  siall_i1 (gfc_array_i1 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
     }
diff --git a/libgfortran/generated/iall_i16.c b/libgfortran/generated/iall_i16.c
index 98deeed4a4a..663ebfde0d1 100644
--- a/libgfortran/generated/iall_i16.c
+++ b/libgfortran/generated/iall_i16.c
@@ -106,12 +106,7 @@  iall_i16 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miall_i16 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -465,11 +456,7 @@  siall_i16 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/iall_i2.c b/libgfortran/generated/iall_i2.c
index 9ed8079c2ef..e78b408ad9c 100644
--- a/libgfortran/generated/iall_i2.c
+++ b/libgfortran/generated/iall_i2.c
@@ -106,12 +106,7 @@  iall_i2 (gfc_array_i2 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miall_i2 (gfc_array_i2 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
@@ -465,11 +456,7 @@  siall_i2 (gfc_array_i2 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
     }
diff --git a/libgfortran/generated/iall_i4.c b/libgfortran/generated/iall_i4.c
index 6e5c4a80ae5..aff64195d39 100644
--- a/libgfortran/generated/iall_i4.c
+++ b/libgfortran/generated/iall_i4.c
@@ -106,12 +106,7 @@  iall_i4 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miall_i4 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -465,11 +456,7 @@  siall_i4 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/iall_i8.c b/libgfortran/generated/iall_i8.c
index 7eddce7f211..4b3681321a6 100644
--- a/libgfortran/generated/iall_i8.c
+++ b/libgfortran/generated/iall_i8.c
@@ -106,12 +106,7 @@  iall_i8 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miall_i8 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -465,11 +456,7 @@  siall_i8 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/iany_i1.c b/libgfortran/generated/iany_i1.c
index 43ec43ee89b..d3723314fdf 100644
--- a/libgfortran/generated/iany_i1.c
+++ b/libgfortran/generated/iany_i1.c
@@ -106,12 +106,7 @@  iany_i1 (gfc_array_i1 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miany_i1 (gfc_array_i1 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
@@ -465,11 +456,7 @@  siany_i1 (gfc_array_i1 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
     }
diff --git a/libgfortran/generated/iany_i16.c b/libgfortran/generated/iany_i16.c
index d5a30607d99..68509b72e3b 100644
--- a/libgfortran/generated/iany_i16.c
+++ b/libgfortran/generated/iany_i16.c
@@ -106,12 +106,7 @@  iany_i16 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miany_i16 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -465,11 +456,7 @@  siany_i16 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/iany_i2.c b/libgfortran/generated/iany_i2.c
index 4086bd1dbd2..542879a2caf 100644
--- a/libgfortran/generated/iany_i2.c
+++ b/libgfortran/generated/iany_i2.c
@@ -106,12 +106,7 @@  iany_i2 (gfc_array_i2 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miany_i2 (gfc_array_i2 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
@@ -465,11 +456,7 @@  siany_i2 (gfc_array_i2 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
     }
diff --git a/libgfortran/generated/iany_i4.c b/libgfortran/generated/iany_i4.c
index 7076f0c4c3b..e131066e1fa 100644
--- a/libgfortran/generated/iany_i4.c
+++ b/libgfortran/generated/iany_i4.c
@@ -106,12 +106,7 @@  iany_i4 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miany_i4 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -465,11 +456,7 @@  siany_i4 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/iany_i8.c b/libgfortran/generated/iany_i8.c
index a648fe8c45f..9dcfe0d8a4f 100644
--- a/libgfortran/generated/iany_i8.c
+++ b/libgfortran/generated/iany_i8.c
@@ -106,12 +106,7 @@  iany_i8 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miany_i8 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -465,11 +456,7 @@  siany_i8 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/iparity_i1.c b/libgfortran/generated/iparity_i1.c
index 26144505efe..27343ba8490 100644
--- a/libgfortran/generated/iparity_i1.c
+++ b/libgfortran/generated/iparity_i1.c
@@ -106,12 +106,7 @@  iparity_i1 (gfc_array_i1 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miparity_i1 (gfc_array_i1 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
@@ -465,11 +456,7 @@  siparity_i1 (gfc_array_i1 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
     }
diff --git a/libgfortran/generated/iparity_i16.c b/libgfortran/generated/iparity_i16.c
index 165a1a81418..507032637fb 100644
--- a/libgfortran/generated/iparity_i16.c
+++ b/libgfortran/generated/iparity_i16.c
@@ -106,12 +106,7 @@  iparity_i16 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miparity_i16 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -465,11 +456,7 @@  siparity_i16 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/iparity_i2.c b/libgfortran/generated/iparity_i2.c
index e2ba668a562..87f511e702b 100644
--- a/libgfortran/generated/iparity_i2.c
+++ b/libgfortran/generated/iparity_i2.c
@@ -106,12 +106,7 @@  iparity_i2 (gfc_array_i2 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miparity_i2 (gfc_array_i2 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
@@ -465,11 +456,7 @@  siparity_i2 (gfc_array_i2 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
     }
diff --git a/libgfortran/generated/iparity_i4.c b/libgfortran/generated/iparity_i4.c
index c5c74c2e1d4..c157743cc7c 100644
--- a/libgfortran/generated/iparity_i4.c
+++ b/libgfortran/generated/iparity_i4.c
@@ -106,12 +106,7 @@  iparity_i4 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miparity_i4 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -465,11 +456,7 @@  siparity_i4 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/iparity_i8.c b/libgfortran/generated/iparity_i8.c
index aebc4f05833..ce3134208f7 100644
--- a/libgfortran/generated/iparity_i8.c
+++ b/libgfortran/generated/iparity_i8.c
@@ -106,12 +106,7 @@  iparity_i8 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  miparity_i8 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -465,11 +456,7 @@  siparity_i8 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/maxloc1_16_i1.c b/libgfortran/generated/maxloc1_16_i1.c
index 66ac5f3cbf4..0705f5b6aa9 100644
--- a/libgfortran/generated/maxloc1_16_i1.c
+++ b/libgfortran/generated/maxloc1_16_i1.c
@@ -109,12 +109,7 @@  maxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -536,11 +527,7 @@  smaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/maxloc1_16_i16.c b/libgfortran/generated/maxloc1_16_i16.c
index 445a4c4e53b..029244da289 100644
--- a/libgfortran/generated/maxloc1_16_i16.c
+++ b/libgfortran/generated/maxloc1_16_i16.c
@@ -109,12 +109,7 @@  maxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -536,11 +527,7 @@  smaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/maxloc1_16_i2.c b/libgfortran/generated/maxloc1_16_i2.c
index ebae5ad552a..bf5ce1f1e64 100644
--- a/libgfortran/generated/maxloc1_16_i2.c
+++ b/libgfortran/generated/maxloc1_16_i2.c
@@ -109,12 +109,7 @@  maxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -536,11 +527,7 @@  smaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/maxloc1_16_i4.c b/libgfortran/generated/maxloc1_16_i4.c
index 5e1019c119a..ec6532dba3a 100644
--- a/libgfortran/generated/maxloc1_16_i4.c
+++ b/libgfortran/generated/maxloc1_16_i4.c
@@ -109,12 +109,7 @@  maxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -536,11 +527,7 @@  smaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/maxloc1_16_i8.c b/libgfortran/generated/maxloc1_16_i8.c
index 8c1a34bc213..1d54a8fab9b 100644
--- a/libgfortran/generated/maxloc1_16_i8.c
+++ b/libgfortran/generated/maxloc1_16_i8.c
@@ -109,12 +109,7 @@  maxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -536,11 +527,7 @@  smaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/maxloc1_16_r10.c b/libgfortran/generated/maxloc1_16_r10.c
index 602347a2db7..8c84667270d 100644
--- a/libgfortran/generated/maxloc1_16_r10.c
+++ b/libgfortran/generated/maxloc1_16_r10.c
@@ -109,12 +109,7 @@  maxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -536,11 +527,7 @@  smaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/maxloc1_16_r16.c b/libgfortran/generated/maxloc1_16_r16.c
index 56b3130d698..19d8a238996 100644
--- a/libgfortran/generated/maxloc1_16_r16.c
+++ b/libgfortran/generated/maxloc1_16_r16.c
@@ -109,12 +109,7 @@  maxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -536,11 +527,7 @@  smaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/maxloc1_16_r17.c b/libgfortran/generated/maxloc1_16_r17.c
index 771c595c166..250a78cdde9 100644
--- a/libgfortran/generated/maxloc1_16_r17.c
+++ b/libgfortran/generated/maxloc1_16_r17.c
@@ -109,12 +109,7 @@  maxloc1_16_r17 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_16_r17 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -536,11 +527,7 @@  smaxloc1_16_r17 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/maxloc1_16_r4.c b/libgfortran/generated/maxloc1_16_r4.c
index ba3273f84fa..d8f51853c3d 100644
--- a/libgfortran/generated/maxloc1_16_r4.c
+++ b/libgfortran/generated/maxloc1_16_r4.c
@@ -109,12 +109,7 @@  maxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -536,11 +527,7 @@  smaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/maxloc1_16_r8.c b/libgfortran/generated/maxloc1_16_r8.c
index 916c6bbb0da..b86491d6a32 100644
--- a/libgfortran/generated/maxloc1_16_r8.c
+++ b/libgfortran/generated/maxloc1_16_r8.c
@@ -109,12 +109,7 @@  maxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -536,11 +527,7 @@  smaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/maxloc1_16_s1.c b/libgfortran/generated/maxloc1_16_s1.c
index 8032ed0c545..fc162d9e9aa 100644
--- a/libgfortran/generated/maxloc1_16_s1.c
+++ b/libgfortran/generated/maxloc1_16_s1.c
@@ -121,12 +121,7 @@  maxloc1_16_s1 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -321,11 +316,7 @@  mmaxloc1_16_s1 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -502,11 +493,7 @@  smaxloc1_16_s1 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/maxloc1_16_s4.c b/libgfortran/generated/maxloc1_16_s4.c
index 15b6af6032e..5cb2500cc32 100644
--- a/libgfortran/generated/maxloc1_16_s4.c
+++ b/libgfortran/generated/maxloc1_16_s4.c
@@ -121,12 +121,7 @@  maxloc1_16_s4 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -321,11 +316,7 @@  mmaxloc1_16_s4 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -502,11 +493,7 @@  smaxloc1_16_s4 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/maxloc1_4_i1.c b/libgfortran/generated/maxloc1_4_i1.c
index 3e90849cbe3..127ab7e650d 100644
--- a/libgfortran/generated/maxloc1_4_i1.c
+++ b/libgfortran/generated/maxloc1_4_i1.c
@@ -109,12 +109,7 @@  maxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -536,11 +527,7 @@  smaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/maxloc1_4_i16.c b/libgfortran/generated/maxloc1_4_i16.c
index d41e3567468..58c6868b141 100644
--- a/libgfortran/generated/maxloc1_4_i16.c
+++ b/libgfortran/generated/maxloc1_4_i16.c
@@ -109,12 +109,7 @@  maxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -536,11 +527,7 @@  smaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/maxloc1_4_i2.c b/libgfortran/generated/maxloc1_4_i2.c
index 5a931197e0b..efafb979825 100644
--- a/libgfortran/generated/maxloc1_4_i2.c
+++ b/libgfortran/generated/maxloc1_4_i2.c
@@ -109,12 +109,7 @@  maxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -536,11 +527,7 @@  smaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/maxloc1_4_i4.c b/libgfortran/generated/maxloc1_4_i4.c
index 5eba4baa0f1..ef69e696ca0 100644
--- a/libgfortran/generated/maxloc1_4_i4.c
+++ b/libgfortran/generated/maxloc1_4_i4.c
@@ -109,12 +109,7 @@  maxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -536,11 +527,7 @@  smaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/maxloc1_4_i8.c b/libgfortran/generated/maxloc1_4_i8.c
index f1293580afa..c80e23c3e28 100644
--- a/libgfortran/generated/maxloc1_4_i8.c
+++ b/libgfortran/generated/maxloc1_4_i8.c
@@ -109,12 +109,7 @@  maxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -536,11 +527,7 @@  smaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/maxloc1_4_r10.c b/libgfortran/generated/maxloc1_4_r10.c
index 163b306ba70..01648273521 100644
--- a/libgfortran/generated/maxloc1_4_r10.c
+++ b/libgfortran/generated/maxloc1_4_r10.c
@@ -109,12 +109,7 @@  maxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -536,11 +527,7 @@  smaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/maxloc1_4_r16.c b/libgfortran/generated/maxloc1_4_r16.c
index cbde21450bc..ba37d0a9843 100644
--- a/libgfortran/generated/maxloc1_4_r16.c
+++ b/libgfortran/generated/maxloc1_4_r16.c
@@ -109,12 +109,7 @@  maxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -536,11 +527,7 @@  smaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/maxloc1_4_r17.c b/libgfortran/generated/maxloc1_4_r17.c
index 24477055a4a..bae0b1c67cc 100644
--- a/libgfortran/generated/maxloc1_4_r17.c
+++ b/libgfortran/generated/maxloc1_4_r17.c
@@ -109,12 +109,7 @@  maxloc1_4_r17 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_4_r17 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -536,11 +527,7 @@  smaxloc1_4_r17 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/maxloc1_4_r4.c b/libgfortran/generated/maxloc1_4_r4.c
index 1ca7d7a8f09..5083b0d5051 100644
--- a/libgfortran/generated/maxloc1_4_r4.c
+++ b/libgfortran/generated/maxloc1_4_r4.c
@@ -109,12 +109,7 @@  maxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -536,11 +527,7 @@  smaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/maxloc1_4_r8.c b/libgfortran/generated/maxloc1_4_r8.c
index 41b42fcae51..0034e0e3b05 100644
--- a/libgfortran/generated/maxloc1_4_r8.c
+++ b/libgfortran/generated/maxloc1_4_r8.c
@@ -109,12 +109,7 @@  maxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -536,11 +527,7 @@  smaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/maxloc1_4_s1.c b/libgfortran/generated/maxloc1_4_s1.c
index c7a967fe440..43862b9f482 100644
--- a/libgfortran/generated/maxloc1_4_s1.c
+++ b/libgfortran/generated/maxloc1_4_s1.c
@@ -121,12 +121,7 @@  maxloc1_4_s1 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -321,11 +316,7 @@  mmaxloc1_4_s1 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -502,11 +493,7 @@  smaxloc1_4_s1 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/maxloc1_4_s4.c b/libgfortran/generated/maxloc1_4_s4.c
index 68311d27d1e..7ffdb4beb57 100644
--- a/libgfortran/generated/maxloc1_4_s4.c
+++ b/libgfortran/generated/maxloc1_4_s4.c
@@ -121,12 +121,7 @@  maxloc1_4_s4 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -321,11 +316,7 @@  mmaxloc1_4_s4 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -502,11 +493,7 @@  smaxloc1_4_s4 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/maxloc1_8_i1.c b/libgfortran/generated/maxloc1_8_i1.c
index 229bb97c357..fb1c03ea5ca 100644
--- a/libgfortran/generated/maxloc1_8_i1.c
+++ b/libgfortran/generated/maxloc1_8_i1.c
@@ -109,12 +109,7 @@  maxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -536,11 +527,7 @@  smaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/maxloc1_8_i16.c b/libgfortran/generated/maxloc1_8_i16.c
index 61b2c2c2ace..eafa7758ba3 100644
--- a/libgfortran/generated/maxloc1_8_i16.c
+++ b/libgfortran/generated/maxloc1_8_i16.c
@@ -109,12 +109,7 @@  maxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -536,11 +527,7 @@  smaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/maxloc1_8_i2.c b/libgfortran/generated/maxloc1_8_i2.c
index 79386822e23..ce2f4cbb216 100644
--- a/libgfortran/generated/maxloc1_8_i2.c
+++ b/libgfortran/generated/maxloc1_8_i2.c
@@ -109,12 +109,7 @@  maxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -536,11 +527,7 @@  smaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/maxloc1_8_i4.c b/libgfortran/generated/maxloc1_8_i4.c
index 6c92bde7499..287c57fd54e 100644
--- a/libgfortran/generated/maxloc1_8_i4.c
+++ b/libgfortran/generated/maxloc1_8_i4.c
@@ -109,12 +109,7 @@  maxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -536,11 +527,7 @@  smaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/maxloc1_8_i8.c b/libgfortran/generated/maxloc1_8_i8.c
index 25efec05793..491df03e9a8 100644
--- a/libgfortran/generated/maxloc1_8_i8.c
+++ b/libgfortran/generated/maxloc1_8_i8.c
@@ -109,12 +109,7 @@  maxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -536,11 +527,7 @@  smaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/maxloc1_8_r10.c b/libgfortran/generated/maxloc1_8_r10.c
index 5de342dc9c0..a2dea45d80a 100644
--- a/libgfortran/generated/maxloc1_8_r10.c
+++ b/libgfortran/generated/maxloc1_8_r10.c
@@ -109,12 +109,7 @@  maxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -536,11 +527,7 @@  smaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/maxloc1_8_r16.c b/libgfortran/generated/maxloc1_8_r16.c
index 57e53d43225..50401952769 100644
--- a/libgfortran/generated/maxloc1_8_r16.c
+++ b/libgfortran/generated/maxloc1_8_r16.c
@@ -109,12 +109,7 @@  maxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -536,11 +527,7 @@  smaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/maxloc1_8_r17.c b/libgfortran/generated/maxloc1_8_r17.c
index 0e108aa37d9..fa81227459d 100644
--- a/libgfortran/generated/maxloc1_8_r17.c
+++ b/libgfortran/generated/maxloc1_8_r17.c
@@ -109,12 +109,7 @@  maxloc1_8_r17 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_8_r17 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -536,11 +527,7 @@  smaxloc1_8_r17 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/maxloc1_8_r4.c b/libgfortran/generated/maxloc1_8_r4.c
index f8d3305b898..417056ae8f2 100644
--- a/libgfortran/generated/maxloc1_8_r4.c
+++ b/libgfortran/generated/maxloc1_8_r4.c
@@ -109,12 +109,7 @@  maxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -536,11 +527,7 @@  smaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/maxloc1_8_r8.c b/libgfortran/generated/maxloc1_8_r8.c
index 74119b89aea..c7f71b56630 100644
--- a/libgfortran/generated/maxloc1_8_r8.c
+++ b/libgfortran/generated/maxloc1_8_r8.c
@@ -109,12 +109,7 @@  maxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -328,11 +323,7 @@  mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -536,11 +527,7 @@  smaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/maxloc1_8_s1.c b/libgfortran/generated/maxloc1_8_s1.c
index 6b905eb5995..a3f841a5486 100644
--- a/libgfortran/generated/maxloc1_8_s1.c
+++ b/libgfortran/generated/maxloc1_8_s1.c
@@ -121,12 +121,7 @@  maxloc1_8_s1 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -321,11 +316,7 @@  mmaxloc1_8_s1 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -502,11 +493,7 @@  smaxloc1_8_s1 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/maxloc1_8_s4.c b/libgfortran/generated/maxloc1_8_s4.c
index 5bc8ce4ffbd..1de13f4e2f1 100644
--- a/libgfortran/generated/maxloc1_8_s4.c
+++ b/libgfortran/generated/maxloc1_8_s4.c
@@ -121,12 +121,7 @@  maxloc1_8_s4 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -321,11 +316,7 @@  mmaxloc1_8_s4 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -502,11 +493,7 @@  smaxloc1_8_s4 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/maxval1_s1.c b/libgfortran/generated/maxval1_s1.c
index d9094913e86..3ec3e22cb93 100644
--- a/libgfortran/generated/maxval1_s1.c
+++ b/libgfortran/generated/maxval1_s1.c
@@ -121,12 +121,7 @@  maxval1_s1 (gfc_array_s1 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_UINTEGER_1));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -317,11 +312,7 @@  mmaxval1_s1 (gfc_array_s1 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_UINTEGER_1));
 
@@ -495,11 +486,7 @@  smaxval1_s1 (gfc_array_s1 * const restrict retarray,
       		 * string_len;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_UINTEGER_1));
     }
diff --git a/libgfortran/generated/maxval1_s4.c b/libgfortran/generated/maxval1_s4.c
index ab1b33ad4a3..be84fd476fb 100644
--- a/libgfortran/generated/maxval1_s4.c
+++ b/libgfortran/generated/maxval1_s4.c
@@ -121,12 +121,7 @@  maxval1_s4 (gfc_array_s4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_UINTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -317,11 +312,7 @@  mmaxval1_s4 (gfc_array_s4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_UINTEGER_4));
 
@@ -495,11 +486,7 @@  smaxval1_s4 (gfc_array_s4 * const restrict retarray,
       		 * string_len;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_UINTEGER_4));
     }
diff --git a/libgfortran/generated/maxval_i1.c b/libgfortran/generated/maxval_i1.c
index 11c75d21616..d7d35c8bf2d 100644
--- a/libgfortran/generated/maxval_i1.c
+++ b/libgfortran/generated/maxval_i1.c
@@ -106,12 +106,7 @@  maxval_i1 (gfc_array_i1 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mmaxval_i1 (gfc_array_i1 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
@@ -507,11 +498,7 @@  smaxval_i1 (gfc_array_i1 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
     }
diff --git a/libgfortran/generated/maxval_i16.c b/libgfortran/generated/maxval_i16.c
index 8608393cd0d..6999f015b36 100644
--- a/libgfortran/generated/maxval_i16.c
+++ b/libgfortran/generated/maxval_i16.c
@@ -106,12 +106,7 @@  maxval_i16 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mmaxval_i16 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -507,11 +498,7 @@  smaxval_i16 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/maxval_i2.c b/libgfortran/generated/maxval_i2.c
index e722773120c..97f0088f185 100644
--- a/libgfortran/generated/maxval_i2.c
+++ b/libgfortran/generated/maxval_i2.c
@@ -106,12 +106,7 @@  maxval_i2 (gfc_array_i2 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mmaxval_i2 (gfc_array_i2 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
@@ -507,11 +498,7 @@  smaxval_i2 (gfc_array_i2 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
     }
diff --git a/libgfortran/generated/maxval_i4.c b/libgfortran/generated/maxval_i4.c
index 0d5401153c8..5bbaffbe383 100644
--- a/libgfortran/generated/maxval_i4.c
+++ b/libgfortran/generated/maxval_i4.c
@@ -106,12 +106,7 @@  maxval_i4 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mmaxval_i4 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -507,11 +498,7 @@  smaxval_i4 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/maxval_i8.c b/libgfortran/generated/maxval_i8.c
index 5a15f768b9d..2996c40c5d7 100644
--- a/libgfortran/generated/maxval_i8.c
+++ b/libgfortran/generated/maxval_i8.c
@@ -106,12 +106,7 @@  maxval_i8 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mmaxval_i8 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -507,11 +498,7 @@  smaxval_i8 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/maxval_r10.c b/libgfortran/generated/maxval_r10.c
index aa781b9a4b0..a2701a81f97 100644
--- a/libgfortran/generated/maxval_r10.c
+++ b/libgfortran/generated/maxval_r10.c
@@ -106,12 +106,7 @@  maxval_r10 (gfc_array_r10 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mmaxval_r10 (gfc_array_r10 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
@@ -507,11 +498,7 @@  smaxval_r10 (gfc_array_r10 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
     }
diff --git a/libgfortran/generated/maxval_r16.c b/libgfortran/generated/maxval_r16.c
index 1dfc0514907..02db24e4956 100644
--- a/libgfortran/generated/maxval_r16.c
+++ b/libgfortran/generated/maxval_r16.c
@@ -106,12 +106,7 @@  maxval_r16 (gfc_array_r16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mmaxval_r16 (gfc_array_r16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
@@ -507,11 +498,7 @@  smaxval_r16 (gfc_array_r16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
     }
diff --git a/libgfortran/generated/maxval_r17.c b/libgfortran/generated/maxval_r17.c
index 50e4614a9d1..c79154aa7bb 100644
--- a/libgfortran/generated/maxval_r17.c
+++ b/libgfortran/generated/maxval_r17.c
@@ -106,12 +106,7 @@  maxval_r17 (gfc_array_r17 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_17));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mmaxval_r17 (gfc_array_r17 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_17));
 
@@ -507,11 +498,7 @@  smaxval_r17 (gfc_array_r17 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_17));
     }
diff --git a/libgfortran/generated/maxval_r4.c b/libgfortran/generated/maxval_r4.c
index c3f03038b6a..19353d2db65 100644
--- a/libgfortran/generated/maxval_r4.c
+++ b/libgfortran/generated/maxval_r4.c
@@ -106,12 +106,7 @@  maxval_r4 (gfc_array_r4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mmaxval_r4 (gfc_array_r4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
@@ -507,11 +498,7 @@  smaxval_r4 (gfc_array_r4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
     }
diff --git a/libgfortran/generated/maxval_r8.c b/libgfortran/generated/maxval_r8.c
index 9954a3f8c66..27dbbf3d84b 100644
--- a/libgfortran/generated/maxval_r8.c
+++ b/libgfortran/generated/maxval_r8.c
@@ -106,12 +106,7 @@  maxval_r8 (gfc_array_r8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mmaxval_r8 (gfc_array_r8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
@@ -507,11 +498,7 @@  smaxval_r8 (gfc_array_r8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
     }
diff --git a/libgfortran/generated/minloc1_16_i1.c b/libgfortran/generated/minloc1_16_i1.c
index ab16257db2f..d0b516fa4de 100644
--- a/libgfortran/generated/minloc1_16_i1.c
+++ b/libgfortran/generated/minloc1_16_i1.c
@@ -109,12 +109,7 @@  minloc1_16_i1 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -546,11 +537,7 @@  sminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/minloc1_16_i16.c b/libgfortran/generated/minloc1_16_i16.c
index 98bd80a0978..93826df33ce 100644
--- a/libgfortran/generated/minloc1_16_i16.c
+++ b/libgfortran/generated/minloc1_16_i16.c
@@ -109,12 +109,7 @@  minloc1_16_i16 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -546,11 +537,7 @@  sminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/minloc1_16_i2.c b/libgfortran/generated/minloc1_16_i2.c
index 0351f284cff..89e6b0406a7 100644
--- a/libgfortran/generated/minloc1_16_i2.c
+++ b/libgfortran/generated/minloc1_16_i2.c
@@ -109,12 +109,7 @@  minloc1_16_i2 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -546,11 +537,7 @@  sminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/minloc1_16_i4.c b/libgfortran/generated/minloc1_16_i4.c
index 469d9a544a6..439ae14e269 100644
--- a/libgfortran/generated/minloc1_16_i4.c
+++ b/libgfortran/generated/minloc1_16_i4.c
@@ -109,12 +109,7 @@  minloc1_16_i4 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -546,11 +537,7 @@  sminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/minloc1_16_i8.c b/libgfortran/generated/minloc1_16_i8.c
index f027f240ccf..5971f5af6ae 100644
--- a/libgfortran/generated/minloc1_16_i8.c
+++ b/libgfortran/generated/minloc1_16_i8.c
@@ -109,12 +109,7 @@  minloc1_16_i8 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -546,11 +537,7 @@  sminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/minloc1_16_r10.c b/libgfortran/generated/minloc1_16_r10.c
index fa019e8518a..12e5c64e94d 100644
--- a/libgfortran/generated/minloc1_16_r10.c
+++ b/libgfortran/generated/minloc1_16_r10.c
@@ -109,12 +109,7 @@  minloc1_16_r10 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -546,11 +537,7 @@  sminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/minloc1_16_r16.c b/libgfortran/generated/minloc1_16_r16.c
index b588aebd07d..716992e58e9 100644
--- a/libgfortran/generated/minloc1_16_r16.c
+++ b/libgfortran/generated/minloc1_16_r16.c
@@ -109,12 +109,7 @@  minloc1_16_r16 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -546,11 +537,7 @@  sminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/minloc1_16_r17.c b/libgfortran/generated/minloc1_16_r17.c
index c3df2151e43..3b27ba55f52 100644
--- a/libgfortran/generated/minloc1_16_r17.c
+++ b/libgfortran/generated/minloc1_16_r17.c
@@ -109,12 +109,7 @@  minloc1_16_r17 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_16_r17 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -546,11 +537,7 @@  sminloc1_16_r17 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/minloc1_16_r4.c b/libgfortran/generated/minloc1_16_r4.c
index 4ba9e19d6cc..f35f5906dc6 100644
--- a/libgfortran/generated/minloc1_16_r4.c
+++ b/libgfortran/generated/minloc1_16_r4.c
@@ -109,12 +109,7 @@  minloc1_16_r4 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -546,11 +537,7 @@  sminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/minloc1_16_r8.c b/libgfortran/generated/minloc1_16_r8.c
index 9dcd143b1e4..e1433e7e94e 100644
--- a/libgfortran/generated/minloc1_16_r8.c
+++ b/libgfortran/generated/minloc1_16_r8.c
@@ -109,12 +109,7 @@  minloc1_16_r8 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -546,11 +537,7 @@  sminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/minloc1_16_s1.c b/libgfortran/generated/minloc1_16_s1.c
index d7bbecf0bbd..2211b905cd1 100644
--- a/libgfortran/generated/minloc1_16_s1.c
+++ b/libgfortran/generated/minloc1_16_s1.c
@@ -121,12 +121,7 @@  minloc1_16_s1 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -321,11 +316,7 @@  mminloc1_16_s1 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -502,11 +493,7 @@  sminloc1_16_s1 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/minloc1_16_s4.c b/libgfortran/generated/minloc1_16_s4.c
index 860abd58a8d..ab77ceb8323 100644
--- a/libgfortran/generated/minloc1_16_s4.c
+++ b/libgfortran/generated/minloc1_16_s4.c
@@ -121,12 +121,7 @@  minloc1_16_s4 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -321,11 +316,7 @@  mminloc1_16_s4 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -502,11 +493,7 @@  sminloc1_16_s4 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/minloc1_4_i1.c b/libgfortran/generated/minloc1_4_i1.c
index a970851c773..d5868f50136 100644
--- a/libgfortran/generated/minloc1_4_i1.c
+++ b/libgfortran/generated/minloc1_4_i1.c
@@ -109,12 +109,7 @@  minloc1_4_i1 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -546,11 +537,7 @@  sminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/minloc1_4_i16.c b/libgfortran/generated/minloc1_4_i16.c
index 9df9e185f3f..152918f8f4a 100644
--- a/libgfortran/generated/minloc1_4_i16.c
+++ b/libgfortran/generated/minloc1_4_i16.c
@@ -109,12 +109,7 @@  minloc1_4_i16 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -546,11 +537,7 @@  sminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/minloc1_4_i2.c b/libgfortran/generated/minloc1_4_i2.c
index ad74b523c37..5271f1edcab 100644
--- a/libgfortran/generated/minloc1_4_i2.c
+++ b/libgfortran/generated/minloc1_4_i2.c
@@ -109,12 +109,7 @@  minloc1_4_i2 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -546,11 +537,7 @@  sminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/minloc1_4_i4.c b/libgfortran/generated/minloc1_4_i4.c
index a8a63fb0a8b..a9cdad7a1d1 100644
--- a/libgfortran/generated/minloc1_4_i4.c
+++ b/libgfortran/generated/minloc1_4_i4.c
@@ -109,12 +109,7 @@  minloc1_4_i4 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -546,11 +537,7 @@  sminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/minloc1_4_i8.c b/libgfortran/generated/minloc1_4_i8.c
index fbecd43fa1a..8f02fefe82c 100644
--- a/libgfortran/generated/minloc1_4_i8.c
+++ b/libgfortran/generated/minloc1_4_i8.c
@@ -109,12 +109,7 @@  minloc1_4_i8 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -546,11 +537,7 @@  sminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/minloc1_4_r10.c b/libgfortran/generated/minloc1_4_r10.c
index 154cc016d0b..4e2f8b75c2f 100644
--- a/libgfortran/generated/minloc1_4_r10.c
+++ b/libgfortran/generated/minloc1_4_r10.c
@@ -109,12 +109,7 @@  minloc1_4_r10 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -546,11 +537,7 @@  sminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/minloc1_4_r16.c b/libgfortran/generated/minloc1_4_r16.c
index 6ee86021840..0cd5a1d07f3 100644
--- a/libgfortran/generated/minloc1_4_r16.c
+++ b/libgfortran/generated/minloc1_4_r16.c
@@ -109,12 +109,7 @@  minloc1_4_r16 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -546,11 +537,7 @@  sminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/minloc1_4_r17.c b/libgfortran/generated/minloc1_4_r17.c
index c2cdfbc88c6..46e816ae172 100644
--- a/libgfortran/generated/minloc1_4_r17.c
+++ b/libgfortran/generated/minloc1_4_r17.c
@@ -109,12 +109,7 @@  minloc1_4_r17 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_4_r17 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -546,11 +537,7 @@  sminloc1_4_r17 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/minloc1_4_r4.c b/libgfortran/generated/minloc1_4_r4.c
index f0a805fdf75..421937dd85a 100644
--- a/libgfortran/generated/minloc1_4_r4.c
+++ b/libgfortran/generated/minloc1_4_r4.c
@@ -109,12 +109,7 @@  minloc1_4_r4 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -546,11 +537,7 @@  sminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/minloc1_4_r8.c b/libgfortran/generated/minloc1_4_r8.c
index 97dbb15e824..304495ae215 100644
--- a/libgfortran/generated/minloc1_4_r8.c
+++ b/libgfortran/generated/minloc1_4_r8.c
@@ -109,12 +109,7 @@  minloc1_4_r8 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -546,11 +537,7 @@  sminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/minloc1_4_s1.c b/libgfortran/generated/minloc1_4_s1.c
index 1d3bfbdef15..2d30d7d39bf 100644
--- a/libgfortran/generated/minloc1_4_s1.c
+++ b/libgfortran/generated/minloc1_4_s1.c
@@ -121,12 +121,7 @@  minloc1_4_s1 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -321,11 +316,7 @@  mminloc1_4_s1 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -502,11 +493,7 @@  sminloc1_4_s1 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/minloc1_4_s4.c b/libgfortran/generated/minloc1_4_s4.c
index cfdff545f32..4cf8571c8d3 100644
--- a/libgfortran/generated/minloc1_4_s4.c
+++ b/libgfortran/generated/minloc1_4_s4.c
@@ -121,12 +121,7 @@  minloc1_4_s4 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -321,11 +316,7 @@  mminloc1_4_s4 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -502,11 +493,7 @@  sminloc1_4_s4 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/minloc1_8_i1.c b/libgfortran/generated/minloc1_8_i1.c
index 0cccb4f8186..4e642d09875 100644
--- a/libgfortran/generated/minloc1_8_i1.c
+++ b/libgfortran/generated/minloc1_8_i1.c
@@ -109,12 +109,7 @@  minloc1_8_i1 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -546,11 +537,7 @@  sminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/minloc1_8_i16.c b/libgfortran/generated/minloc1_8_i16.c
index 6c66f84d68e..0875435c4d6 100644
--- a/libgfortran/generated/minloc1_8_i16.c
+++ b/libgfortran/generated/minloc1_8_i16.c
@@ -109,12 +109,7 @@  minloc1_8_i16 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -546,11 +537,7 @@  sminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/minloc1_8_i2.c b/libgfortran/generated/minloc1_8_i2.c
index ea24ead4b4a..e5d3d5a91bd 100644
--- a/libgfortran/generated/minloc1_8_i2.c
+++ b/libgfortran/generated/minloc1_8_i2.c
@@ -109,12 +109,7 @@  minloc1_8_i2 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -546,11 +537,7 @@  sminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/minloc1_8_i4.c b/libgfortran/generated/minloc1_8_i4.c
index b55bc480bf5..cbde677864f 100644
--- a/libgfortran/generated/minloc1_8_i4.c
+++ b/libgfortran/generated/minloc1_8_i4.c
@@ -109,12 +109,7 @@  minloc1_8_i4 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -546,11 +537,7 @@  sminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/minloc1_8_i8.c b/libgfortran/generated/minloc1_8_i8.c
index 44b6107cc26..141f0c1d441 100644
--- a/libgfortran/generated/minloc1_8_i8.c
+++ b/libgfortran/generated/minloc1_8_i8.c
@@ -109,12 +109,7 @@  minloc1_8_i8 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -546,11 +537,7 @@  sminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/minloc1_8_r10.c b/libgfortran/generated/minloc1_8_r10.c
index b093b3f6ad0..d617408f420 100644
--- a/libgfortran/generated/minloc1_8_r10.c
+++ b/libgfortran/generated/minloc1_8_r10.c
@@ -109,12 +109,7 @@  minloc1_8_r10 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -546,11 +537,7 @@  sminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/minloc1_8_r16.c b/libgfortran/generated/minloc1_8_r16.c
index 7c660c828ac..95158f99c3c 100644
--- a/libgfortran/generated/minloc1_8_r16.c
+++ b/libgfortran/generated/minloc1_8_r16.c
@@ -109,12 +109,7 @@  minloc1_8_r16 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -546,11 +537,7 @@  sminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/minloc1_8_r17.c b/libgfortran/generated/minloc1_8_r17.c
index f9c95330b32..6a27faa9e82 100644
--- a/libgfortran/generated/minloc1_8_r17.c
+++ b/libgfortran/generated/minloc1_8_r17.c
@@ -109,12 +109,7 @@  minloc1_8_r17 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_8_r17 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -546,11 +537,7 @@  sminloc1_8_r17 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/minloc1_8_r4.c b/libgfortran/generated/minloc1_8_r4.c
index b0956bdd81a..0ccecd369e4 100644
--- a/libgfortran/generated/minloc1_8_r4.c
+++ b/libgfortran/generated/minloc1_8_r4.c
@@ -109,12 +109,7 @@  minloc1_8_r4 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -546,11 +537,7 @@  sminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/minloc1_8_r8.c b/libgfortran/generated/minloc1_8_r8.c
index da96e942f2d..f9c8fc57743 100644
--- a/libgfortran/generated/minloc1_8_r8.c
+++ b/libgfortran/generated/minloc1_8_r8.c
@@ -109,12 +109,7 @@  minloc1_8_r8 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -338,11 +333,7 @@  mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -546,11 +537,7 @@  sminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/minloc1_8_s1.c b/libgfortran/generated/minloc1_8_s1.c
index 1f091780339..f9e5f9ec05f 100644
--- a/libgfortran/generated/minloc1_8_s1.c
+++ b/libgfortran/generated/minloc1_8_s1.c
@@ -121,12 +121,7 @@  minloc1_8_s1 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -321,11 +316,7 @@  mminloc1_8_s1 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -502,11 +493,7 @@  sminloc1_8_s1 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/minloc1_8_s4.c b/libgfortran/generated/minloc1_8_s4.c
index 5a04345e0a9..15c98988307 100644
--- a/libgfortran/generated/minloc1_8_s4.c
+++ b/libgfortran/generated/minloc1_8_s4.c
@@ -121,12 +121,7 @@  minloc1_8_s4 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -321,11 +316,7 @@  mminloc1_8_s4 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -502,11 +493,7 @@  sminloc1_8_s4 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/minval1_s1.c b/libgfortran/generated/minval1_s1.c
index 60f65fd9439..a6397a83bdc 100644
--- a/libgfortran/generated/minval1_s1.c
+++ b/libgfortran/generated/minval1_s1.c
@@ -121,12 +121,7 @@  minval1_s1 (gfc_array_s1 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_UINTEGER_1));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -317,11 +312,7 @@  mminval1_s1 (gfc_array_s1 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_UINTEGER_1));
 
@@ -495,11 +486,7 @@  sminval1_s1 (gfc_array_s1 * const restrict retarray,
       		 * string_len;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_UINTEGER_1));
     }
diff --git a/libgfortran/generated/minval1_s4.c b/libgfortran/generated/minval1_s4.c
index e8252991a18..247446d6398 100644
--- a/libgfortran/generated/minval1_s4.c
+++ b/libgfortran/generated/minval1_s4.c
@@ -121,12 +121,7 @@  minval1_s4 (gfc_array_s4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_UINTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -317,11 +312,7 @@  mminval1_s4 (gfc_array_s4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_UINTEGER_4));
 
@@ -495,11 +486,7 @@  sminval1_s4 (gfc_array_s4 * const restrict retarray,
       		 * string_len;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_UINTEGER_4));
     }
diff --git a/libgfortran/generated/minval_i1.c b/libgfortran/generated/minval_i1.c
index 352380d8a12..326a72aee80 100644
--- a/libgfortran/generated/minval_i1.c
+++ b/libgfortran/generated/minval_i1.c
@@ -106,12 +106,7 @@  minval_i1 (gfc_array_i1 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mminval_i1 (gfc_array_i1 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
@@ -507,11 +498,7 @@  sminval_i1 (gfc_array_i1 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
     }
diff --git a/libgfortran/generated/minval_i16.c b/libgfortran/generated/minval_i16.c
index a9bd75070fd..744d4a31577 100644
--- a/libgfortran/generated/minval_i16.c
+++ b/libgfortran/generated/minval_i16.c
@@ -106,12 +106,7 @@  minval_i16 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mminval_i16 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -507,11 +498,7 @@  sminval_i16 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/minval_i2.c b/libgfortran/generated/minval_i2.c
index 990b47adafe..65c425a3170 100644
--- a/libgfortran/generated/minval_i2.c
+++ b/libgfortran/generated/minval_i2.c
@@ -106,12 +106,7 @@  minval_i2 (gfc_array_i2 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mminval_i2 (gfc_array_i2 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
@@ -507,11 +498,7 @@  sminval_i2 (gfc_array_i2 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
     }
diff --git a/libgfortran/generated/minval_i4.c b/libgfortran/generated/minval_i4.c
index 237242cbf1c..03c32a533d0 100644
--- a/libgfortran/generated/minval_i4.c
+++ b/libgfortran/generated/minval_i4.c
@@ -106,12 +106,7 @@  minval_i4 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mminval_i4 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -507,11 +498,7 @@  sminval_i4 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/minval_i8.c b/libgfortran/generated/minval_i8.c
index 61f26acf2b5..6405fe72877 100644
--- a/libgfortran/generated/minval_i8.c
+++ b/libgfortran/generated/minval_i8.c
@@ -106,12 +106,7 @@  minval_i8 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mminval_i8 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -507,11 +498,7 @@  sminval_i8 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/minval_r10.c b/libgfortran/generated/minval_r10.c
index 63f21e966d4..624dd34b56c 100644
--- a/libgfortran/generated/minval_r10.c
+++ b/libgfortran/generated/minval_r10.c
@@ -106,12 +106,7 @@  minval_r10 (gfc_array_r10 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mminval_r10 (gfc_array_r10 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
@@ -507,11 +498,7 @@  sminval_r10 (gfc_array_r10 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
     }
diff --git a/libgfortran/generated/minval_r16.c b/libgfortran/generated/minval_r16.c
index ae9b1223b8e..9e0c078b3d8 100644
--- a/libgfortran/generated/minval_r16.c
+++ b/libgfortran/generated/minval_r16.c
@@ -106,12 +106,7 @@  minval_r16 (gfc_array_r16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mminval_r16 (gfc_array_r16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
@@ -507,11 +498,7 @@  sminval_r16 (gfc_array_r16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
     }
diff --git a/libgfortran/generated/minval_r17.c b/libgfortran/generated/minval_r17.c
index fc1b6ba4e9b..bc611e3fe9e 100644
--- a/libgfortran/generated/minval_r17.c
+++ b/libgfortran/generated/minval_r17.c
@@ -106,12 +106,7 @@  minval_r17 (gfc_array_r17 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_17));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mminval_r17 (gfc_array_r17 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_17));
 
@@ -507,11 +498,7 @@  sminval_r17 (gfc_array_r17 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_17));
     }
diff --git a/libgfortran/generated/minval_r4.c b/libgfortran/generated/minval_r4.c
index 010fb9e5a09..d7569589081 100644
--- a/libgfortran/generated/minval_r4.c
+++ b/libgfortran/generated/minval_r4.c
@@ -106,12 +106,7 @@  minval_r4 (gfc_array_r4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mminval_r4 (gfc_array_r4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
@@ -507,11 +498,7 @@  sminval_r4 (gfc_array_r4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
     }
diff --git a/libgfortran/generated/minval_r8.c b/libgfortran/generated/minval_r8.c
index c9a6b0d9da8..222f9480001 100644
--- a/libgfortran/generated/minval_r8.c
+++ b/libgfortran/generated/minval_r8.c
@@ -106,12 +106,7 @@  minval_r8 (gfc_array_r8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -314,11 +309,7 @@  mminval_r8 (gfc_array_r8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
@@ -507,11 +498,7 @@  sminval_r8 (gfc_array_r8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
     }
diff --git a/libgfortran/generated/norm2_r10.c b/libgfortran/generated/norm2_r10.c
index c844ade8b21..8afad2fe16e 100644
--- a/libgfortran/generated/norm2_r10.c
+++ b/libgfortran/generated/norm2_r10.c
@@ -109,12 +109,7 @@  norm2_r10 (gfc_array_r10 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/norm2_r16.c b/libgfortran/generated/norm2_r16.c
index 0d4f8deb15d..88ed972d75f 100644
--- a/libgfortran/generated/norm2_r16.c
+++ b/libgfortran/generated/norm2_r16.c
@@ -117,12 +117,7 @@  norm2_r16 (gfc_array_r16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/norm2_r17.c b/libgfortran/generated/norm2_r17.c
index 5a69e52bcd0..9cef5cb3cc0 100644
--- a/libgfortran/generated/norm2_r17.c
+++ b/libgfortran/generated/norm2_r17.c
@@ -115,12 +115,7 @@  norm2_r17 (gfc_array_r17 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_17));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/norm2_r4.c b/libgfortran/generated/norm2_r4.c
index 2e023f08668..16e0e962f74 100644
--- a/libgfortran/generated/norm2_r4.c
+++ b/libgfortran/generated/norm2_r4.c
@@ -109,12 +109,7 @@  norm2_r4 (gfc_array_r4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/norm2_r8.c b/libgfortran/generated/norm2_r8.c
index 5494eaef284..5462f6186d2 100644
--- a/libgfortran/generated/norm2_r8.c
+++ b/libgfortran/generated/norm2_r8.c
@@ -109,12 +109,7 @@  norm2_r8 (gfc_array_r8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/parity_l1.c b/libgfortran/generated/parity_l1.c
index e8ee6bd3bac..731b862091a 100644
--- a/libgfortran/generated/parity_l1.c
+++ b/libgfortran/generated/parity_l1.c
@@ -106,12 +106,7 @@  parity_l1 (gfc_array_l1 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_1));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/parity_l16.c b/libgfortran/generated/parity_l16.c
index 03707a234ad..3dd883e328b 100644
--- a/libgfortran/generated/parity_l16.c
+++ b/libgfortran/generated/parity_l16.c
@@ -106,12 +106,7 @@  parity_l16 (gfc_array_l16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/parity_l2.c b/libgfortran/generated/parity_l2.c
index 00aa0245ed0..90cc272ffe0 100644
--- a/libgfortran/generated/parity_l2.c
+++ b/libgfortran/generated/parity_l2.c
@@ -106,12 +106,7 @@  parity_l2 (gfc_array_l2 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_2));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/parity_l4.c b/libgfortran/generated/parity_l4.c
index 08a1e433ad9..108755982bf 100644
--- a/libgfortran/generated/parity_l4.c
+++ b/libgfortran/generated/parity_l4.c
@@ -106,12 +106,7 @@  parity_l4 (gfc_array_l4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/parity_l8.c b/libgfortran/generated/parity_l8.c
index a55e221c72c..8e3ddaae666 100644
--- a/libgfortran/generated/parity_l8.c
+++ b/libgfortran/generated/parity_l8.c
@@ -106,12 +106,7 @@  parity_l8 (gfc_array_l8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_LOGICAL_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/generated/product_c10.c b/libgfortran/generated/product_c10.c
index 7b97f6b5161..6d7a5b2fb4e 100644
--- a/libgfortran/generated/product_c10.c
+++ b/libgfortran/generated/product_c10.c
@@ -106,12 +106,7 @@  product_c10 (gfc_array_c10 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_c10 (gfc_array_c10 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
@@ -465,11 +456,7 @@  sproduct_c10 (gfc_array_c10 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
     }
diff --git a/libgfortran/generated/product_c16.c b/libgfortran/generated/product_c16.c
index 202b90ac288..fbdb26ad353 100644
--- a/libgfortran/generated/product_c16.c
+++ b/libgfortran/generated/product_c16.c
@@ -106,12 +106,7 @@  product_c16 (gfc_array_c16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_c16 (gfc_array_c16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
@@ -465,11 +456,7 @@  sproduct_c16 (gfc_array_c16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
     }
diff --git a/libgfortran/generated/product_c17.c b/libgfortran/generated/product_c17.c
index 49e87391315..8382d5d3735 100644
--- a/libgfortran/generated/product_c17.c
+++ b/libgfortran/generated/product_c17.c
@@ -106,12 +106,7 @@  product_c17 (gfc_array_c17 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_17));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_c17 (gfc_array_c17 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_17));
 
@@ -465,11 +456,7 @@  sproduct_c17 (gfc_array_c17 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_17));
     }
diff --git a/libgfortran/generated/product_c4.c b/libgfortran/generated/product_c4.c
index 513557c740e..1d255c04b74 100644
--- a/libgfortran/generated/product_c4.c
+++ b/libgfortran/generated/product_c4.c
@@ -106,12 +106,7 @@  product_c4 (gfc_array_c4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_c4 (gfc_array_c4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
@@ -465,11 +456,7 @@  sproduct_c4 (gfc_array_c4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
     }
diff --git a/libgfortran/generated/product_c8.c b/libgfortran/generated/product_c8.c
index 5de40c6e43c..50e2ca720a0 100644
--- a/libgfortran/generated/product_c8.c
+++ b/libgfortran/generated/product_c8.c
@@ -106,12 +106,7 @@  product_c8 (gfc_array_c8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_c8 (gfc_array_c8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
@@ -465,11 +456,7 @@  sproduct_c8 (gfc_array_c8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
     }
diff --git a/libgfortran/generated/product_i1.c b/libgfortran/generated/product_i1.c
index 0502bdfa845..0a2d5a5643e 100644
--- a/libgfortran/generated/product_i1.c
+++ b/libgfortran/generated/product_i1.c
@@ -106,12 +106,7 @@  product_i1 (gfc_array_i1 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_i1 (gfc_array_i1 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
@@ -465,11 +456,7 @@  sproduct_i1 (gfc_array_i1 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
     }
diff --git a/libgfortran/generated/product_i16.c b/libgfortran/generated/product_i16.c
index 41f7cb5fde0..7bcf1c06ead 100644
--- a/libgfortran/generated/product_i16.c
+++ b/libgfortran/generated/product_i16.c
@@ -106,12 +106,7 @@  product_i16 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_i16 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -465,11 +456,7 @@  sproduct_i16 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/product_i2.c b/libgfortran/generated/product_i2.c
index cfd5291634d..9dc4ce6dbfd 100644
--- a/libgfortran/generated/product_i2.c
+++ b/libgfortran/generated/product_i2.c
@@ -106,12 +106,7 @@  product_i2 (gfc_array_i2 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_i2 (gfc_array_i2 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
@@ -465,11 +456,7 @@  sproduct_i2 (gfc_array_i2 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
     }
diff --git a/libgfortran/generated/product_i4.c b/libgfortran/generated/product_i4.c
index 9482e3fd64e..db623ed2150 100644
--- a/libgfortran/generated/product_i4.c
+++ b/libgfortran/generated/product_i4.c
@@ -106,12 +106,7 @@  product_i4 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_i4 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -465,11 +456,7 @@  sproduct_i4 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/product_i8.c b/libgfortran/generated/product_i8.c
index 38ae86199be..9c5db3028d2 100644
--- a/libgfortran/generated/product_i8.c
+++ b/libgfortran/generated/product_i8.c
@@ -106,12 +106,7 @@  product_i8 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_i8 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -465,11 +456,7 @@  sproduct_i8 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/product_r10.c b/libgfortran/generated/product_r10.c
index 63fb76dfd30..800d71b213c 100644
--- a/libgfortran/generated/product_r10.c
+++ b/libgfortran/generated/product_r10.c
@@ -106,12 +106,7 @@  product_r10 (gfc_array_r10 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_r10 (gfc_array_r10 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
@@ -465,11 +456,7 @@  sproduct_r10 (gfc_array_r10 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
     }
diff --git a/libgfortran/generated/product_r16.c b/libgfortran/generated/product_r16.c
index d6a67c8c68c..22712fb156a 100644
--- a/libgfortran/generated/product_r16.c
+++ b/libgfortran/generated/product_r16.c
@@ -106,12 +106,7 @@  product_r16 (gfc_array_r16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_r16 (gfc_array_r16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
@@ -465,11 +456,7 @@  sproduct_r16 (gfc_array_r16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
     }
diff --git a/libgfortran/generated/product_r17.c b/libgfortran/generated/product_r17.c
index c927057225a..d9ed706f114 100644
--- a/libgfortran/generated/product_r17.c
+++ b/libgfortran/generated/product_r17.c
@@ -106,12 +106,7 @@  product_r17 (gfc_array_r17 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_17));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_r17 (gfc_array_r17 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_17));
 
@@ -465,11 +456,7 @@  sproduct_r17 (gfc_array_r17 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_17));
     }
diff --git a/libgfortran/generated/product_r4.c b/libgfortran/generated/product_r4.c
index 8167b8215f1..0daf85026a9 100644
--- a/libgfortran/generated/product_r4.c
+++ b/libgfortran/generated/product_r4.c
@@ -106,12 +106,7 @@  product_r4 (gfc_array_r4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_r4 (gfc_array_r4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
@@ -465,11 +456,7 @@  sproduct_r4 (gfc_array_r4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
     }
diff --git a/libgfortran/generated/product_r8.c b/libgfortran/generated/product_r8.c
index 2c0a231c3f7..755e4fe177a 100644
--- a/libgfortran/generated/product_r8.c
+++ b/libgfortran/generated/product_r8.c
@@ -106,12 +106,7 @@  product_r8 (gfc_array_r8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  mproduct_r8 (gfc_array_r8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
@@ -465,11 +456,7 @@  sproduct_r8 (gfc_array_r8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
     }
diff --git a/libgfortran/generated/sum_c10.c b/libgfortran/generated/sum_c10.c
index b3c8b790c9d..bb72b053fcb 100644
--- a/libgfortran/generated/sum_c10.c
+++ b/libgfortran/generated/sum_c10.c
@@ -106,12 +106,7 @@  sum_c10 (gfc_array_c10 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_c10 (gfc_array_c10 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
 
@@ -465,11 +456,7 @@  ssum_c10 (gfc_array_c10 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_10));
     }
diff --git a/libgfortran/generated/sum_c16.c b/libgfortran/generated/sum_c16.c
index aa912e7d659..ecce9b37dfd 100644
--- a/libgfortran/generated/sum_c16.c
+++ b/libgfortran/generated/sum_c16.c
@@ -106,12 +106,7 @@  sum_c16 (gfc_array_c16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_c16 (gfc_array_c16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
 
@@ -465,11 +456,7 @@  ssum_c16 (gfc_array_c16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_16));
     }
diff --git a/libgfortran/generated/sum_c17.c b/libgfortran/generated/sum_c17.c
index ea6514ae08e..13cb6430490 100644
--- a/libgfortran/generated/sum_c17.c
+++ b/libgfortran/generated/sum_c17.c
@@ -106,12 +106,7 @@  sum_c17 (gfc_array_c17 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_17));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_c17 (gfc_array_c17 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_17));
 
@@ -465,11 +456,7 @@  ssum_c17 (gfc_array_c17 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_17));
     }
diff --git a/libgfortran/generated/sum_c4.c b/libgfortran/generated/sum_c4.c
index 6c02d6381f2..e3f4de7b282 100644
--- a/libgfortran/generated/sum_c4.c
+++ b/libgfortran/generated/sum_c4.c
@@ -106,12 +106,7 @@  sum_c4 (gfc_array_c4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_c4 (gfc_array_c4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
 
@@ -465,11 +456,7 @@  ssum_c4 (gfc_array_c4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_4));
     }
diff --git a/libgfortran/generated/sum_c8.c b/libgfortran/generated/sum_c8.c
index eb4641d447f..ab868fac6eb 100644
--- a/libgfortran/generated/sum_c8.c
+++ b/libgfortran/generated/sum_c8.c
@@ -106,12 +106,7 @@  sum_c8 (gfc_array_c8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_c8 (gfc_array_c8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
 
@@ -465,11 +456,7 @@  ssum_c8 (gfc_array_c8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_COMPLEX_8));
     }
diff --git a/libgfortran/generated/sum_i1.c b/libgfortran/generated/sum_i1.c
index 27d80284296..f8d4e890e9a 100644
--- a/libgfortran/generated/sum_i1.c
+++ b/libgfortran/generated/sum_i1.c
@@ -106,12 +106,7 @@  sum_i1 (gfc_array_i1 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_i1 (gfc_array_i1 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
 
@@ -465,11 +456,7 @@  ssum_i1 (gfc_array_i1 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_1));
     }
diff --git a/libgfortran/generated/sum_i16.c b/libgfortran/generated/sum_i16.c
index 592ae925493..96896e710b1 100644
--- a/libgfortran/generated/sum_i16.c
+++ b/libgfortran/generated/sum_i16.c
@@ -106,12 +106,7 @@  sum_i16 (gfc_array_i16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_i16 (gfc_array_i16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
 
@@ -465,11 +456,7 @@  ssum_i16 (gfc_array_i16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_16));
     }
diff --git a/libgfortran/generated/sum_i2.c b/libgfortran/generated/sum_i2.c
index 54d91ab1a43..a9d3643e579 100644
--- a/libgfortran/generated/sum_i2.c
+++ b/libgfortran/generated/sum_i2.c
@@ -106,12 +106,7 @@  sum_i2 (gfc_array_i2 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_i2 (gfc_array_i2 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
 
@@ -465,11 +456,7 @@  ssum_i2 (gfc_array_i2 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_2));
     }
diff --git a/libgfortran/generated/sum_i4.c b/libgfortran/generated/sum_i4.c
index aa27839110d..74a2b5ce3e2 100644
--- a/libgfortran/generated/sum_i4.c
+++ b/libgfortran/generated/sum_i4.c
@@ -106,12 +106,7 @@  sum_i4 (gfc_array_i4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_i4 (gfc_array_i4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
 
@@ -465,11 +456,7 @@  ssum_i4 (gfc_array_i4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_4));
     }
diff --git a/libgfortran/generated/sum_i8.c b/libgfortran/generated/sum_i8.c
index a7836ed99f4..4fc6af67706 100644
--- a/libgfortran/generated/sum_i8.c
+++ b/libgfortran/generated/sum_i8.c
@@ -106,12 +106,7 @@  sum_i8 (gfc_array_i8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_i8 (gfc_array_i8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
@@ -465,11 +456,7 @@  ssum_i8 (gfc_array_i8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
diff --git a/libgfortran/generated/sum_r10.c b/libgfortran/generated/sum_r10.c
index 5efe6a2bce4..cc03d0a7cc1 100644
--- a/libgfortran/generated/sum_r10.c
+++ b/libgfortran/generated/sum_r10.c
@@ -106,12 +106,7 @@  sum_r10 (gfc_array_r10 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_r10 (gfc_array_r10 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
 
@@ -465,11 +456,7 @@  ssum_r10 (gfc_array_r10 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_10));
     }
diff --git a/libgfortran/generated/sum_r16.c b/libgfortran/generated/sum_r16.c
index feedb4a5139..75fe19f2b33 100644
--- a/libgfortran/generated/sum_r16.c
+++ b/libgfortran/generated/sum_r16.c
@@ -106,12 +106,7 @@  sum_r16 (gfc_array_r16 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_r16 (gfc_array_r16 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
 
@@ -465,11 +456,7 @@  ssum_r16 (gfc_array_r16 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_16));
     }
diff --git a/libgfortran/generated/sum_r17.c b/libgfortran/generated/sum_r17.c
index fdbf84783a9..a245b843472 100644
--- a/libgfortran/generated/sum_r17.c
+++ b/libgfortran/generated/sum_r17.c
@@ -106,12 +106,7 @@  sum_r17 (gfc_array_r17 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_17));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_r17 (gfc_array_r17 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_17));
 
@@ -465,11 +456,7 @@  ssum_r17 (gfc_array_r17 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_17));
     }
diff --git a/libgfortran/generated/sum_r4.c b/libgfortran/generated/sum_r4.c
index 4a7ab4a6c1a..105ba0fccc2 100644
--- a/libgfortran/generated/sum_r4.c
+++ b/libgfortran/generated/sum_r4.c
@@ -106,12 +106,7 @@  sum_r4 (gfc_array_r4 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_r4 (gfc_array_r4 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
 
@@ -465,11 +456,7 @@  ssum_r4 (gfc_array_r4 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
     }
diff --git a/libgfortran/generated/sum_r8.c b/libgfortran/generated/sum_r8.c
index a83dd93348f..e5e71d94d94 100644
--- a/libgfortran/generated/sum_r8.c
+++ b/libgfortran/generated/sum_r8.c
@@ -106,12 +106,7 @@  sum_r8 (gfc_array_r8 * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -300,11 +295,7 @@  msum_r8 (gfc_array_r8 * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
 
@@ -465,11 +456,7 @@  ssum_r8 (gfc_array_r8 * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_8));
     }
diff --git a/libgfortran/m4/ifindloc1.m4 b/libgfortran/m4/ifindloc1.m4
index a1c5be6848d..68a39f326d4 100644
--- a/libgfortran/m4/ifindloc1.m4
+++ b/libgfortran/m4/ifindloc1.m4
@@ -97,11 +97,7 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -275,11 +271,7 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
@@ -438,11 +430,7 @@  see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (index_type));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
     }
   else
     {
diff --git a/libgfortran/m4/ifunction-s.m4 b/libgfortran/m4/ifunction-s.m4
index 19f665f50ad..9307b900d91 100644
--- a/libgfortran/m4/ifunction-s.m4
+++ b/libgfortran/m4/ifunction-s.m4
@@ -109,12 +109,7 @@  void
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -302,11 +297,7 @@  m'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
 
@@ -466,11 +457,7 @@  s'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
     }
diff --git a/libgfortran/m4/ifunction-s2.m4 b/libgfortran/m4/ifunction-s2.m4
index 5d9870e8640..8cb5d1172cc 100644
--- a/libgfortran/m4/ifunction-s2.m4
+++ b/libgfortran/m4/ifunction-s2.m4
@@ -111,12 +111,7 @@  name`'rtype_qual`_'atype_code (rtype * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -303,11 +298,7 @@  void
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
 
@@ -467,11 +458,7 @@  void
       		 * string_len;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
     }
diff --git a/libgfortran/m4/ifunction.m4 b/libgfortran/m4/ifunction.m4
index 480649cf691..abc15b430ab 100644
--- a/libgfortran/m4/ifunction.m4
+++ b/libgfortran/m4/ifunction.m4
@@ -96,12 +96,7 @@  name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray,
 
       retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-
-	}
+	return;
     }
   else
     {
@@ -290,11 +285,7 @@  m'name`'rtype_qual`_'atype_code` ('rtype` * const restrict retarray,
       retarray->dtype.rank = rank;
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
 
@@ -454,11 +445,7 @@  void
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
     }
diff --git a/libgfortran/m4/ifunction_logical.m4 b/libgfortran/m4/ifunction_logical.m4
index 0568387e343..d33eb44e373 100644
--- a/libgfortran/m4/ifunction_logical.m4
+++ b/libgfortran/m4/ifunction_logical.m4
@@ -92,11 +92,7 @@  name`'rtype_qual`_'atype_code (rtype * const restrict retarray,
       alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
-	{
-	  /* Make sure we have a zero-sized array.  */
-	  GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1);
-	  return;
-	}
+	return;
       else
 	retarray->base_addr = xmallocarray (alloc_size, sizeof (rtype_name));
     }