From 62715bf891979cfb8c6684fdcd65b06a28bbbf5c Mon Sep 17 00:00:00 2001
From: Mikael Morin <mikael@gcc.gnu.org>
Date: Tue, 7 Nov 2023 11:24:04 +0100
Subject: [PATCH] libgfortran: Remove empty array descriptor first dimension
 overwrite [PR112371]

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

diff --git a/gcc/testsuite/gfortran.dg/bound_11.f90 b/gcc/testsuite/gfortran.dg/bound_11.f90
new file mode 100644
index 000000000000..170eba4ddfd4
--- /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 e49428114612..aacc5ac0793a 100644
--- a/libgfortran/generated/all_l1.c
+++ b/libgfortran/generated/all_l1.c
@@ -103,11 +103,7 @@ all_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/all_l16.c b/libgfortran/generated/all_l16.c
index 1fc45bfd97c0..e1b2e157c378 100644
--- a/libgfortran/generated/all_l16.c
+++ b/libgfortran/generated/all_l16.c
@@ -103,11 +103,7 @@ all_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/all_l2.c b/libgfortran/generated/all_l2.c
index f6dbf1c456dc..045196eb13b4 100644
--- a/libgfortran/generated/all_l2.c
+++ b/libgfortran/generated/all_l2.c
@@ -103,11 +103,7 @@ all_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/all_l4.c b/libgfortran/generated/all_l4.c
index 7f915ef9c615..7783d966697a 100644
--- a/libgfortran/generated/all_l4.c
+++ b/libgfortran/generated/all_l4.c
@@ -103,11 +103,7 @@ all_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/all_l8.c b/libgfortran/generated/all_l8.c
index 3fa8147c1a15..a9571003b48c 100644
--- a/libgfortran/generated/all_l8.c
+++ b/libgfortran/generated/all_l8.c
@@ -103,11 +103,7 @@ all_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/any_l1.c b/libgfortran/generated/any_l1.c
index 236e4100ec23..ce38a9761cb7 100644
--- a/libgfortran/generated/any_l1.c
+++ b/libgfortran/generated/any_l1.c
@@ -103,11 +103,7 @@ any_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/any_l16.c b/libgfortran/generated/any_l16.c
index 7290d66667e8..771c6fcbc2e0 100644
--- a/libgfortran/generated/any_l16.c
+++ b/libgfortran/generated/any_l16.c
@@ -103,11 +103,7 @@ any_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/any_l2.c b/libgfortran/generated/any_l2.c
index d54e78fda0c7..69a0d4745769 100644
--- a/libgfortran/generated/any_l2.c
+++ b/libgfortran/generated/any_l2.c
@@ -103,11 +103,7 @@ any_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/any_l4.c b/libgfortran/generated/any_l4.c
index a577bc582138..08e4cff945e6 100644
--- a/libgfortran/generated/any_l4.c
+++ b/libgfortran/generated/any_l4.c
@@ -103,11 +103,7 @@ any_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/any_l8.c b/libgfortran/generated/any_l8.c
index 0af302746f58..259bd30f780f 100644
--- a/libgfortran/generated/any_l8.c
+++ b/libgfortran/generated/any_l8.c
@@ -103,11 +103,7 @@ any_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/count_16_l.c b/libgfortran/generated/count_16_l.c
index 89f4f753d1a5..f7319d0e84b0 100644
--- a/libgfortran/generated/count_16_l.c
+++ b/libgfortran/generated/count_16_l.c
@@ -103,11 +103,7 @@ count_16_l (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
     {
diff --git a/libgfortran/generated/count_1_l.c b/libgfortran/generated/count_1_l.c
index 05b8b898e941..919388ff18a2 100644
--- a/libgfortran/generated/count_1_l.c
+++ b/libgfortran/generated/count_1_l.c
@@ -103,11 +103,7 @@ count_1_l (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
     {
diff --git a/libgfortran/generated/count_2_l.c b/libgfortran/generated/count_2_l.c
index 654b21589d00..493cd15e5d24 100644
--- a/libgfortran/generated/count_2_l.c
+++ b/libgfortran/generated/count_2_l.c
@@ -103,11 +103,7 @@ count_2_l (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
     {
diff --git a/libgfortran/generated/count_4_l.c b/libgfortran/generated/count_4_l.c
index 8f40ea1c0be8..a308bd7014fd 100644
--- a/libgfortran/generated/count_4_l.c
+++ b/libgfortran/generated/count_4_l.c
@@ -103,11 +103,7 @@ count_4_l (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
     {
diff --git a/libgfortran/generated/count_8_l.c b/libgfortran/generated/count_8_l.c
index ab64c0858034..e23081d00cae 100644
--- a/libgfortran/generated/count_8_l.c
+++ b/libgfortran/generated/count_8_l.c
@@ -103,11 +103,7 @@ count_8_l (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
     {
diff --git a/libgfortran/generated/findloc1_c10.c b/libgfortran/generated/findloc1_c10.c
index 0b7905a101c8..fa68971ff385 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 1cbe1fc5b26a..13e2209dc32e 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 fea16286bf8f..03c651e9c196 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 2c800aa4a777..6c3fe7cd537e 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 9f14e631c9ea..2b4b84b522c1 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 90896ac92a6b..5175198a2953 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 699320dffcd5..c3fcf8b5a2c4 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 d3ebdab8f23b..c00f7b5c2446 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 e030e6bee60e..d1d0247b6561 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 678e65161052..02f219bcc1e8 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 b416fdd0e008..1b824c7d78b6 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 d03b34fbc0bc..9a42849c989a 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 2b72e90506ac..7b95da2b6e76 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 fa216cca4815..8b527728cb0a 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 7f1e044f8e1a..0ac3fd6e73a1 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 2fb81c414af9..85b13bd7c5f4 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 641ca7fa58a7..7b5a020d3147 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 2236f044e650..2a3e52b99838 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
     {
@@ -303,11 +298,7 @@ miall_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
     {
@@ -466,11 +457,7 @@ siall_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
     {
diff --git a/libgfortran/generated/iall_i16.c b/libgfortran/generated/iall_i16.c
index 96ca5a57c9ce..d7bdc55623af 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
     {
@@ -303,11 +298,7 @@ miall_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
     {
@@ -466,11 +457,7 @@ siall_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
     {
diff --git a/libgfortran/generated/iall_i2.c b/libgfortran/generated/iall_i2.c
index 4d895db2b356..ceaaf153efe7 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
     {
@@ -303,11 +298,7 @@ miall_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
     {
@@ -466,11 +457,7 @@ siall_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
     {
diff --git a/libgfortran/generated/iall_i4.c b/libgfortran/generated/iall_i4.c
index 673e98094831..face5d95cc12 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
     {
@@ -303,11 +298,7 @@ miall_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
     {
@@ -466,11 +457,7 @@ siall_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
     {
diff --git a/libgfortran/generated/iall_i8.c b/libgfortran/generated/iall_i8.c
index 4de6ff1782df..7e47c3b8663c 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
     {
@@ -303,11 +298,7 @@ miall_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
     {
@@ -466,11 +457,7 @@ siall_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
     {
diff --git a/libgfortran/generated/iany_i1.c b/libgfortran/generated/iany_i1.c
index ab191d6bdd27..e152ffe85da6 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
     {
@@ -303,11 +298,7 @@ miany_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
     {
@@ -466,11 +457,7 @@ siany_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
     {
diff --git a/libgfortran/generated/iany_i16.c b/libgfortran/generated/iany_i16.c
index 8fda0efea828..bd775b8216b0 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
     {
@@ -303,11 +298,7 @@ miany_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
     {
@@ -466,11 +457,7 @@ siany_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
     {
diff --git a/libgfortran/generated/iany_i2.c b/libgfortran/generated/iany_i2.c
index 43080b859922..956fbdb47974 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
     {
@@ -303,11 +298,7 @@ miany_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
     {
@@ -466,11 +457,7 @@ siany_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
     {
diff --git a/libgfortran/generated/iany_i4.c b/libgfortran/generated/iany_i4.c
index d8430ca4e905..fef7d65b6917 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
     {
@@ -303,11 +298,7 @@ miany_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
     {
@@ -466,11 +457,7 @@ siany_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
     {
diff --git a/libgfortran/generated/iany_i8.c b/libgfortran/generated/iany_i8.c
index 7d3ac16412da..5ddca1f8642e 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
     {
@@ -303,11 +298,7 @@ miany_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
     {
@@ -466,11 +457,7 @@ siany_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
     {
diff --git a/libgfortran/generated/iparity_i1.c b/libgfortran/generated/iparity_i1.c
index 53b15cbb73fb..8076d05ebd6f 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
     {
@@ -303,11 +298,7 @@ miparity_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
     {
@@ -466,11 +457,7 @@ siparity_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
     {
diff --git a/libgfortran/generated/iparity_i16.c b/libgfortran/generated/iparity_i16.c
index 848ac6284fbc..49907fe7cf42 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
     {
@@ -303,11 +298,7 @@ miparity_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
     {
@@ -466,11 +457,7 @@ siparity_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
     {
diff --git a/libgfortran/generated/iparity_i2.c b/libgfortran/generated/iparity_i2.c
index f435fd27edd9..58703bc991b8 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
     {
@@ -303,11 +298,7 @@ miparity_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
     {
@@ -466,11 +457,7 @@ siparity_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
     {
diff --git a/libgfortran/generated/iparity_i4.c b/libgfortran/generated/iparity_i4.c
index ea876bdd31ad..051dd360c1a2 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
     {
@@ -303,11 +298,7 @@ miparity_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
     {
@@ -466,11 +457,7 @@ siparity_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
     {
diff --git a/libgfortran/generated/iparity_i8.c b/libgfortran/generated/iparity_i8.c
index 0fee2e5025d8..90f444e6f96a 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
     {
@@ -303,11 +298,7 @@ miparity_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
     {
@@ -466,11 +457,7 @@ siparity_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
     {
diff --git a/libgfortran/generated/maxloc1_16_i1.c b/libgfortran/generated/maxloc1_16_i1.c
index bc0643cde1e1..3a00cd538a0a 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_16_i16.c b/libgfortran/generated/maxloc1_16_i16.c
index 5dca85c4bc02..bfb3e6f69e92 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_16_i2.c b/libgfortran/generated/maxloc1_16_i2.c
index 118d7c527a14..abe0b89df01c 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_16_i4.c b/libgfortran/generated/maxloc1_16_i4.c
index 858dfc0e8509..46507045035f 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_16_i8.c b/libgfortran/generated/maxloc1_16_i8.c
index 36469e49797e..83ac6a56a6e7 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_16_r10.c b/libgfortran/generated/maxloc1_16_r10.c
index dfc55681b1fb..0dec2116b153 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_16_r16.c b/libgfortran/generated/maxloc1_16_r16.c
index 17daa796afcc..1f75f4471ef9 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_16_r17.c b/libgfortran/generated/maxloc1_16_r17.c
index 46fd4ab320c4..31ff83bab4d7 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_16_r4.c b/libgfortran/generated/maxloc1_16_r4.c
index b52932f70bf0..fea7580b82e1 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_16_r8.c b/libgfortran/generated/maxloc1_16_r8.c
index c26c4b4ed0af..4f2acd645dd5 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_16_s1.c b/libgfortran/generated/maxloc1_16_s1.c
index 54f57238367d..44a27ca565ac 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
     {
@@ -324,11 +319,7 @@ mmaxloc1_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
     {
@@ -503,11 +494,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_16_s4.c b/libgfortran/generated/maxloc1_16_s4.c
index eb015eabef2a..c4686a7d56f2 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
     {
@@ -324,11 +319,7 @@ mmaxloc1_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
     {
@@ -503,11 +494,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_4_i1.c b/libgfortran/generated/maxloc1_4_i1.c
index 4b0bd56a60bd..0e4c644fc49f 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_4_i16.c b/libgfortran/generated/maxloc1_4_i16.c
index d976d2d4b8e6..4094c010342b 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_4_i2.c b/libgfortran/generated/maxloc1_4_i2.c
index ba8228925d46..c552d9022430 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_4_i4.c b/libgfortran/generated/maxloc1_4_i4.c
index 644e48e547fb..76a71219ff52 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_4_i8.c b/libgfortran/generated/maxloc1_4_i8.c
index fd5d31b51624..49a05188db4b 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_4_r10.c b/libgfortran/generated/maxloc1_4_r10.c
index 00c90fa3c66a..4f1a8e88f164 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_4_r16.c b/libgfortran/generated/maxloc1_4_r16.c
index 92372b8d8375..ecb9c2cca034 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_4_r17.c b/libgfortran/generated/maxloc1_4_r17.c
index 10c687521885..a0e43b50b967 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_4_r4.c b/libgfortran/generated/maxloc1_4_r4.c
index b0750c19361a..f79c7ffc4e08 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_4_r8.c b/libgfortran/generated/maxloc1_4_r8.c
index 3be87685eed7..c77b72074b34 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_4_s1.c b/libgfortran/generated/maxloc1_4_s1.c
index 91628645d1cb..d1657b82cd86 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
     {
@@ -324,11 +319,7 @@ mmaxloc1_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
     {
@@ -503,11 +494,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_4_s4.c b/libgfortran/generated/maxloc1_4_s4.c
index 7cb056ea10b1..7727c21847c0 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
     {
@@ -324,11 +319,7 @@ mmaxloc1_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
     {
@@ -503,11 +494,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_8_i1.c b/libgfortran/generated/maxloc1_8_i1.c
index 42b113b1d0cf..4ab9d741f150 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_8_i16.c b/libgfortran/generated/maxloc1_8_i16.c
index 594c735ad77e..817a7770130f 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_8_i2.c b/libgfortran/generated/maxloc1_8_i2.c
index 9e141af3ecd4..57d40b5b52c1 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_8_i4.c b/libgfortran/generated/maxloc1_8_i4.c
index b94c627dfd67..451f860495ce 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_8_i8.c b/libgfortran/generated/maxloc1_8_i8.c
index 18e45033b40a..5f5dbd483111 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_8_r10.c b/libgfortran/generated/maxloc1_8_r10.c
index 22cd8c26e1bb..78928f83937d 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_8_r16.c b/libgfortran/generated/maxloc1_8_r16.c
index 646fe18a9750..5eb1e51d6b26 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_8_r17.c b/libgfortran/generated/maxloc1_8_r17.c
index cc6bb86546c1..3662425c36b3 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_8_r4.c b/libgfortran/generated/maxloc1_8_r4.c
index 2c482bc8ed4c..8d697713705a 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_8_r8.c b/libgfortran/generated/maxloc1_8_r8.c
index 32452d49ff3c..72651d066766 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
     {
@@ -331,11 +326,7 @@ mmaxloc1_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
     {
@@ -537,11 +528,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_8_s1.c b/libgfortran/generated/maxloc1_8_s1.c
index 96ac1ac0bd4a..97fe4890df6a 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
     {
@@ -324,11 +319,7 @@ mmaxloc1_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
     {
@@ -503,11 +494,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxloc1_8_s4.c b/libgfortran/generated/maxloc1_8_s4.c
index 068c4ff7a725..519e4cb6c11c 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
     {
@@ -324,11 +319,7 @@ mmaxloc1_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
     {
@@ -503,11 +494,7 @@ smaxloc1_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
     {
diff --git a/libgfortran/generated/maxval1_s1.c b/libgfortran/generated/maxval1_s1.c
index 6ad5366b8f36..19579023e294 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
     {
@@ -320,11 +315,7 @@ mmaxval1_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
     {
@@ -496,11 +487,7 @@ smaxval1_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
     {
diff --git a/libgfortran/generated/maxval1_s4.c b/libgfortran/generated/maxval1_s4.c
index 6337b043a3ef..501e605b0333 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
     {
@@ -320,11 +315,7 @@ mmaxval1_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
     {
@@ -496,11 +487,7 @@ smaxval1_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
     {
diff --git a/libgfortran/generated/maxval_i1.c b/libgfortran/generated/maxval_i1.c
index 19feced68618..a500d5dd4ff3 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
     {
@@ -317,11 +312,7 @@ mmaxval_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
     {
@@ -508,11 +499,7 @@ smaxval_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
     {
diff --git a/libgfortran/generated/maxval_i16.c b/libgfortran/generated/maxval_i16.c
index cd75603b0660..9833337b5530 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
     {
@@ -317,11 +312,7 @@ mmaxval_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
     {
@@ -508,11 +499,7 @@ smaxval_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
     {
diff --git a/libgfortran/generated/maxval_i2.c b/libgfortran/generated/maxval_i2.c
index 9c7eb7702e3e..d3d4b6adbcb4 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
     {
@@ -317,11 +312,7 @@ mmaxval_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
     {
@@ -508,11 +499,7 @@ smaxval_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
     {
diff --git a/libgfortran/generated/maxval_i4.c b/libgfortran/generated/maxval_i4.c
index 40bf1ce97ab2..b6c6504825bf 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
     {
@@ -317,11 +312,7 @@ mmaxval_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
     {
@@ -508,11 +499,7 @@ smaxval_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
     {
diff --git a/libgfortran/generated/maxval_i8.c b/libgfortran/generated/maxval_i8.c
index 0b6b9f671ee9..418b5b684eb8 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
     {
@@ -317,11 +312,7 @@ mmaxval_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
     {
@@ -508,11 +499,7 @@ smaxval_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
     {
diff --git a/libgfortran/generated/maxval_r10.c b/libgfortran/generated/maxval_r10.c
index f83c4e9965a0..486c16c2f297 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
     {
@@ -317,11 +312,7 @@ mmaxval_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
     {
@@ -508,11 +499,7 @@ smaxval_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/maxval_r16.c b/libgfortran/generated/maxval_r16.c
index ec2d7a92be58..dd9b42754949 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
     {
@@ -317,11 +312,7 @@ mmaxval_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
     {
@@ -508,11 +499,7 @@ smaxval_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/maxval_r17.c b/libgfortran/generated/maxval_r17.c
index 442e2b3a3875..feda95e35d0c 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
     {
@@ -317,11 +312,7 @@ mmaxval_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
     {
@@ -508,11 +499,7 @@ smaxval_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/maxval_r4.c b/libgfortran/generated/maxval_r4.c
index 6c08b342752a..6e1b4fa61d58 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
     {
@@ -317,11 +312,7 @@ mmaxval_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
     {
@@ -508,11 +499,7 @@ smaxval_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/maxval_r8.c b/libgfortran/generated/maxval_r8.c
index 30d259f7708a..2f78627e5e83 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
     {
@@ -317,11 +312,7 @@ mmaxval_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
     {
@@ -508,11 +499,7 @@ smaxval_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/minloc1_16_i1.c b/libgfortran/generated/minloc1_16_i1.c
index 80abb3cf8e06..bf3daefbcf95 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_16_i16.c b/libgfortran/generated/minloc1_16_i16.c
index 388a8f912084..7a7e3433d640 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_16_i2.c b/libgfortran/generated/minloc1_16_i2.c
index 51ae92b91fba..c66d21fdc811 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_16_i4.c b/libgfortran/generated/minloc1_16_i4.c
index 675fc333d52c..9138ec417d1b 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_16_i8.c b/libgfortran/generated/minloc1_16_i8.c
index 6a417880a12b..c974954e86b7 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_16_r10.c b/libgfortran/generated/minloc1_16_r10.c
index f5d9c347ef95..3f6c59a8532e 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_16_r16.c b/libgfortran/generated/minloc1_16_r16.c
index 3405c0e4befe..18cd4c6155ec 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_16_r17.c b/libgfortran/generated/minloc1_16_r17.c
index e3d0d417e5de..02b252b64e7d 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_16_r4.c b/libgfortran/generated/minloc1_16_r4.c
index 8af09702f5ca..b6d5e53c8fe0 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_16_r8.c b/libgfortran/generated/minloc1_16_r8.c
index 9397dc6ff917..6b879bf7c9d9 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_16_s1.c b/libgfortran/generated/minloc1_16_s1.c
index c6d8861a5f48..d6c41c967ab3 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
     {
@@ -324,11 +319,7 @@ mminloc1_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
     {
@@ -503,11 +494,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_16_s4.c b/libgfortran/generated/minloc1_16_s4.c
index 0f5eb2db8696..ef67757329ff 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
     {
@@ -324,11 +319,7 @@ mminloc1_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
     {
@@ -503,11 +494,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_4_i1.c b/libgfortran/generated/minloc1_4_i1.c
index 4274e70dc921..79843660216e 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_4_i16.c b/libgfortran/generated/minloc1_4_i16.c
index ded68f0b0fb5..0c1170a2234f 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_4_i2.c b/libgfortran/generated/minloc1_4_i2.c
index a053dd352e56..3bc567c44ebf 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_4_i4.c b/libgfortran/generated/minloc1_4_i4.c
index 6292fc2d9b77..7d82a18d757e 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_4_i8.c b/libgfortran/generated/minloc1_4_i8.c
index 9240e3fe5bda..cb6836bb32b0 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_4_r10.c b/libgfortran/generated/minloc1_4_r10.c
index 42a9de0b6d04..e7f1a1cd446a 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_4_r16.c b/libgfortran/generated/minloc1_4_r16.c
index 06193f13598e..c0938cd715eb 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_4_r17.c b/libgfortran/generated/minloc1_4_r17.c
index d021d46b9fad..a2b8ad2fb030 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_4_r4.c b/libgfortran/generated/minloc1_4_r4.c
index e6990c6e70e0..c55ab25d2f2c 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_4_r8.c b/libgfortran/generated/minloc1_4_r8.c
index fd1574f64139..8c149a87ef60 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_4_s1.c b/libgfortran/generated/minloc1_4_s1.c
index 5bbc844e1963..54a656e9649e 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
     {
@@ -324,11 +319,7 @@ mminloc1_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
     {
@@ -503,11 +494,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_4_s4.c b/libgfortran/generated/minloc1_4_s4.c
index 4f2ab20ab9f4..fedddac374c9 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
     {
@@ -324,11 +319,7 @@ mminloc1_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
     {
@@ -503,11 +494,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_8_i1.c b/libgfortran/generated/minloc1_8_i1.c
index 1b8b24064d95..17f2e0cbab25 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_8_i16.c b/libgfortran/generated/minloc1_8_i16.c
index 9561270e1502..be829bc255b8 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_8_i2.c b/libgfortran/generated/minloc1_8_i2.c
index 979856579f98..9a3c8e878582 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_8_i4.c b/libgfortran/generated/minloc1_8_i4.c
index 1c303ed6dea3..47c8547bdb93 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_8_i8.c b/libgfortran/generated/minloc1_8_i8.c
index 6249f20ae62d..ca2546699f6e 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_8_r10.c b/libgfortran/generated/minloc1_8_r10.c
index 2c6a0fd8a58b..e4103588f49d 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_8_r16.c b/libgfortran/generated/minloc1_8_r16.c
index f7d06648c379..db9c163dd145 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_8_r17.c b/libgfortran/generated/minloc1_8_r17.c
index 0cc70c439d0d..65241e7b19e0 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_8_r4.c b/libgfortran/generated/minloc1_8_r4.c
index b2ae3dfcc06a..f76e79d857ac 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_8_r8.c b/libgfortran/generated/minloc1_8_r8.c
index bafd72d0893a..730774e910cf 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
     {
@@ -341,11 +336,7 @@ mminloc1_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
     {
@@ -547,11 +538,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_8_s1.c b/libgfortran/generated/minloc1_8_s1.c
index 8a40b52a188f..188a8963a789 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
     {
@@ -324,11 +319,7 @@ mminloc1_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
     {
@@ -503,11 +494,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minloc1_8_s4.c b/libgfortran/generated/minloc1_8_s4.c
index 906d1df9a2e2..f7930de06436 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
     {
@@ -324,11 +319,7 @@ mminloc1_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
     {
@@ -503,11 +494,7 @@ sminloc1_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
     {
diff --git a/libgfortran/generated/minval1_s1.c b/libgfortran/generated/minval1_s1.c
index d83fef19d3c8..859530f16e53 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
     {
@@ -320,11 +315,7 @@ mminval1_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
     {
@@ -496,11 +487,7 @@ sminval1_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
     {
diff --git a/libgfortran/generated/minval1_s4.c b/libgfortran/generated/minval1_s4.c
index 5ef09cdeebb6..d6b5ab6d359a 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
     {
@@ -320,11 +315,7 @@ mminval1_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
     {
@@ -496,11 +487,7 @@ sminval1_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
     {
diff --git a/libgfortran/generated/minval_i1.c b/libgfortran/generated/minval_i1.c
index 544a996a01c3..5972e6c21644 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
     {
@@ -317,11 +312,7 @@ mminval_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
     {
@@ -508,11 +499,7 @@ sminval_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
     {
diff --git a/libgfortran/generated/minval_i16.c b/libgfortran/generated/minval_i16.c
index 1bcdf58792ac..28053b9606b0 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
     {
@@ -317,11 +312,7 @@ mminval_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
     {
@@ -508,11 +499,7 @@ sminval_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
     {
diff --git a/libgfortran/generated/minval_i2.c b/libgfortran/generated/minval_i2.c
index 61801f163f28..8284243db7f9 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
     {
@@ -317,11 +312,7 @@ mminval_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
     {
@@ -508,11 +499,7 @@ sminval_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
     {
diff --git a/libgfortran/generated/minval_i4.c b/libgfortran/generated/minval_i4.c
index 019a880e2abe..fb8385363716 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
     {
@@ -317,11 +312,7 @@ mminval_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
     {
@@ -508,11 +499,7 @@ sminval_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
     {
diff --git a/libgfortran/generated/minval_i8.c b/libgfortran/generated/minval_i8.c
index abbbd06da078..c43d13eef4fc 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
     {
@@ -317,11 +312,7 @@ mminval_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
     {
@@ -508,11 +499,7 @@ sminval_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
     {
diff --git a/libgfortran/generated/minval_r10.c b/libgfortran/generated/minval_r10.c
index d5b9d76d9e6a..b28522a60fab 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
     {
@@ -317,11 +312,7 @@ mminval_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
     {
@@ -508,11 +499,7 @@ sminval_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/minval_r16.c b/libgfortran/generated/minval_r16.c
index 9fdde79f4fcd..75eb72b3347a 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
     {
@@ -317,11 +312,7 @@ mminval_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
     {
@@ -508,11 +499,7 @@ sminval_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/minval_r17.c b/libgfortran/generated/minval_r17.c
index 3e75af04b2da..c3731489d8db 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
     {
@@ -317,11 +312,7 @@ mminval_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
     {
@@ -508,11 +499,7 @@ sminval_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/minval_r4.c b/libgfortran/generated/minval_r4.c
index f096473e5ad7..24d132ac0d10 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
     {
@@ -317,11 +312,7 @@ mminval_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
     {
@@ -508,11 +499,7 @@ sminval_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/minval_r8.c b/libgfortran/generated/minval_r8.c
index 8fafc3c1869d..c44a273f79e4 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
     {
@@ -317,11 +312,7 @@ mminval_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
     {
@@ -508,11 +499,7 @@ sminval_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/norm2_r10.c b/libgfortran/generated/norm2_r10.c
index c844ade8b219..8afad2fe16ee 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 0d4f8deb15d3..88ed972d75f2 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 5a69e52bcd06..9cef5cb3cc0e 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 2e023f08668d..16e0e962f743 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 5494eaef284f..5462f6186d2b 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 e8ee6bd3baca..731b862091a8 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 03707a234ad6..3dd883e328b5 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 00aa0245ed08..90cc272ffe09 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 08a1e433ad93..108755982bfe 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 a55e221c72c0..8e3ddaae6661 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 7ecd80e3346d..b97353e1de98 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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
     {
diff --git a/libgfortran/generated/product_c16.c b/libgfortran/generated/product_c16.c
index e1d0c932a089..1538f605d583 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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
     {
diff --git a/libgfortran/generated/product_c17.c b/libgfortran/generated/product_c17.c
index 2ed08b31f1ee..fba33932d71a 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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
     {
diff --git a/libgfortran/generated/product_c4.c b/libgfortran/generated/product_c4.c
index dbf00aacf7aa..d46eb6968141 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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
     {
diff --git a/libgfortran/generated/product_c8.c b/libgfortran/generated/product_c8.c
index 1a3f27d329e6..ffdc538f12f7 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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
     {
diff --git a/libgfortran/generated/product_i1.c b/libgfortran/generated/product_i1.c
index 35f4f6ec8042..d2abb955c97b 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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
     {
diff --git a/libgfortran/generated/product_i16.c b/libgfortran/generated/product_i16.c
index 3b815036f4fa..9217c1265f11 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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
     {
diff --git a/libgfortran/generated/product_i2.c b/libgfortran/generated/product_i2.c
index e998c0d59c3a..4287fa79868a 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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
     {
diff --git a/libgfortran/generated/product_i4.c b/libgfortran/generated/product_i4.c
index 7dbc77aff9f7..0c8d50901bda 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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
     {
diff --git a/libgfortran/generated/product_i8.c b/libgfortran/generated/product_i8.c
index aaa688b69ffb..555b9cd26f86 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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
     {
diff --git a/libgfortran/generated/product_r10.c b/libgfortran/generated/product_r10.c
index 8a7dba54fddd..5271f55a98e1 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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/product_r16.c b/libgfortran/generated/product_r16.c
index 38c9922ed9bf..6a7c8506490d 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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/product_r17.c b/libgfortran/generated/product_r17.c
index 37ed80c9d3a5..2103ec4da7f4 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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/product_r4.c b/libgfortran/generated/product_r4.c
index 616fd5be89de..f413cf0fc1e6 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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/product_r8.c b/libgfortran/generated/product_r8.c
index c4b710dfc6ff..6d98fcae2eb2 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
     {
@@ -303,11 +298,7 @@ mproduct_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
     {
@@ -466,11 +457,7 @@ sproduct_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/sum_c10.c b/libgfortran/generated/sum_c10.c
index 6de84a7e2ea5..fa8d28d68b4d 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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
     {
diff --git a/libgfortran/generated/sum_c16.c b/libgfortran/generated/sum_c16.c
index 96fc88829021..78dbb88ed79f 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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
     {
diff --git a/libgfortran/generated/sum_c17.c b/libgfortran/generated/sum_c17.c
index 1472fe577334..a392a09da324 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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
     {
diff --git a/libgfortran/generated/sum_c4.c b/libgfortran/generated/sum_c4.c
index 250aa416cb36..0da74be9a61e 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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
     {
diff --git a/libgfortran/generated/sum_c8.c b/libgfortran/generated/sum_c8.c
index 510a25847aca..8d7e18c897c7 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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
     {
diff --git a/libgfortran/generated/sum_i1.c b/libgfortran/generated/sum_i1.c
index 974522b3bbff..387fde4a4730 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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
     {
diff --git a/libgfortran/generated/sum_i16.c b/libgfortran/generated/sum_i16.c
index 00f644bff718..da33649514ef 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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
     {
diff --git a/libgfortran/generated/sum_i2.c b/libgfortran/generated/sum_i2.c
index 448273594f4e..9e49cf5586cc 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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
     {
diff --git a/libgfortran/generated/sum_i4.c b/libgfortran/generated/sum_i4.c
index 529fb2e94a0b..69e31f1d67b2 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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
     {
diff --git a/libgfortran/generated/sum_i8.c b/libgfortran/generated/sum_i8.c
index 7b7ca72aa710..b8c86449df98 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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
     {
diff --git a/libgfortran/generated/sum_r10.c b/libgfortran/generated/sum_r10.c
index 71e71dd91f00..daba1023cb9c 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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/sum_r16.c b/libgfortran/generated/sum_r16.c
index 813cc33dd907..55a4c1f99ecf 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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/sum_r17.c b/libgfortran/generated/sum_r17.c
index 8e82e871bb26..519526f53ad4 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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/sum_r4.c b/libgfortran/generated/sum_r4.c
index 1b37711b99f7..b8cb0a88ca36 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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/sum_r8.c b/libgfortran/generated/sum_r8.c
index 294211ba9bef..6299b5d32c9b 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
     {
@@ -303,11 +298,7 @@ msum_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
     {
@@ -466,11 +457,7 @@ ssum_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/m4/ifindloc1.m4 b/libgfortran/m4/ifindloc1.m4
index a1c5be6848dc..68a39f326d46 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 72793e435aaf..8275f6568c4e 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
     {
@@ -305,11 +300,7 @@ m'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
     {
@@ -467,11 +458,7 @@ s'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
     {
diff --git a/libgfortran/m4/ifunction-s2.m4 b/libgfortran/m4/ifunction-s2.m4
index b936d7c392c4..4189dd9e2d8f 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
     {
@@ -306,11 +301,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
     {
@@ -468,11 +459,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
     {
diff --git a/libgfortran/m4/ifunction.m4 b/libgfortran/m4/ifunction.m4
index f3ab4ebd58dc..8e32d49218b7 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
     {
@@ -293,11 +288,7 @@ m'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
     {
@@ -455,11 +446,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
     {
diff --git a/libgfortran/m4/ifunction_logical.m4 b/libgfortran/m4/ifunction_logical.m4
index cb576f3472ef..5fd776368b3b 100644
--- a/libgfortran/m4/ifunction_logical.m4
+++ b/libgfortran/m4/ifunction_logical.m4
@@ -93,11 +93,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
     {
-- 
GitLab