2012-10-16  Tobias Burnus  <burnus@net-b.de>

	 * m4/bessel.m4: Remove useless statement.
	 * m4/ifunction.m4: Remove unreachable code.
	 * generated/bessel_r10.c: Regenerated.
	 * generated/bessel_r16.c: Regenerated.
	 * generated/bessel_r4.c: Regenerated.
	 * generated/bessel_r8.c: Regenerated.
	 * generated/iall_i1.c: Regenerated.
	 * generated/iall_i16.c: Regenerated.
	 * generated/iall_i2.c: Regenerated.
	 * generated/iall_i4.c: Regenerated.
	 * generated/iall_i8.c: Regenerated.
	 * generated/iany_i1.c: Regenerated.
	 * generated/iany_i16.c: Regenerated.
	 * generated/iany_i2.c: Regenerated.
	 * generated/iany_i4.c: Regenerated.
	 * generated/iany_i8.c: Regenerated.
	 * generated/iparity_i1.c: Regenerated.
	 * generated/iparity_i16.c: Regenerated.
	 * generated/iparity_i2.c: Regenerated.
	 * generated/iparity_i4.c: Regenerated.
	 * generated/iparity_i8.c: Regenerated.
	 * generated/maxloc1_16_i1.c: Regenerated.
	 * generated/maxloc1_16_i16.c: Regenerated.
	 * generated/maxloc1_16_i2.c: Regenerated.
	 * generated/maxloc1_16_i4.c: Regenerated.
	 * generated/maxloc1_16_i8.c: Regenerated.
	 * generated/maxloc1_16_r10.c: Regenerated.
	 * generated/maxloc1_16_r16.c: Regenerated.
	 * generated/maxloc1_16_r4.c: Regenerated.
	 * generated/maxloc1_16_r8.c: Regenerated.
	 * generated/maxloc1_4_i1.c: Regenerated.
	 * generated/maxloc1_4_i16.c: Regenerated.
	 * generated/maxloc1_4_i2.c: Regenerated.
	 * generated/maxloc1_4_i4.c: Regenerated.
	 * generated/maxloc1_4_i8.c: Regenerated.
	 * generated/maxloc1_4_r10.c: Regenerated.
	 * generated/maxloc1_4_r16.c: Regenerated.
	 * generated/maxloc1_4_r4.c: Regenerated.
	 * generated/maxloc1_4_r8.c: Regenerated.
	 * generated/maxloc1_8_i1.c: Regenerated.
	 * generated/maxloc1_8_i16.c: Regenerated.
	 * generated/maxloc1_8_i2.c: Regenerated.
	 * generated/maxloc1_8_i4.c: Regenerated.
	 * generated/maxloc1_8_i8.c: Regenerated.
	 * generated/maxloc1_8_r10.c: Regenerated.
	 * generated/maxloc1_8_r16.c: Regenerated.
	 * generated/maxloc1_8_r4.c: Regenerated.
	 * generated/maxloc1_8_r8.c: Regenerated.
	 * generated/maxval_i1.c: Regenerated.
	 * generated/maxval_i16.c: Regenerated.
	 * generated/maxval_i2.c: Regenerated.
	 * generated/maxval_i4.c: Regenerated.
	 * generated/maxval_i8.c: Regenerated.
	 * generated/maxval_r10.c: Regenerated.
	 * generated/maxval_r16.c: Regenerated.
	 * generated/maxval_r4.c: Regenerated.
	 * generated/maxval_r8.c: Regenerated.
	 * generated/minloc1_16_i1.c: Regenerated.
	 * generated/minloc1_16_i16.c: Regenerated.
	 * generated/minloc1_16_i2.c: Regenerated.
	 * generated/minloc1_16_i4.c: Regenerated.
	 * generated/minloc1_16_i8.c: Regenerated.
	 * generated/minloc1_16_r10.c: Regenerated.
	 * generated/minloc1_16_r16.c: Regenerated.
	 * generated/minloc1_16_r4.c: Regenerated.
	 * generated/minloc1_16_r8.c: Regenerated.
	 * generated/minloc1_4_i1.c: Regenerated.
	 * generated/minloc1_4_i16.c: Regenerated.
	 * generated/minloc1_4_i2.c: Regenerated.
	 * generated/minloc1_4_i4.c: Regenerated.
	 * generated/minloc1_4_i8.c: Regenerated.
	 * generated/minloc1_4_r10.c: Regenerated.
	 * generated/minloc1_4_r16.c: Regenerated.
	 * generated/minloc1_4_r4.c: Regenerated.
	 * generated/minloc1_4_r8.c: Regenerated.
	 * generated/minloc1_8_i1.c: Regenerated.
	 * generated/minloc1_8_i16.c: Regenerated.
	 * generated/minloc1_8_i2.c: Regenerated.
	 * generated/minloc1_8_i4.c: Regenerated.
	 * generated/minloc1_8_i8.c: Regenerated.
	 * generated/minloc1_8_r10.c: Regenerated.
	 * generated/minloc1_8_r16.c: Regenerated.
	 * generated/minloc1_8_r4.c: Regenerated.
	 * generated/minloc1_8_r8.c: Regenerated.
	 * generated/minval_i1.c: Regenerated.
	 * generated/minval_i16.c: Regenerated.
	 * generated/minval_i2.c: Regenerated.
	 * generated/minval_i4.c: Regenerated.
	 * generated/minval_i8.c: Regenerated.
	 * generated/minval_r10.c: Regenerated.
	 * generated/minval_r16.c: Regenerated.
	 * generated/minval_r4.c: Regenerated.
	 * generated/minval_r8.c: Regenerated.
	 * generated/product_c10.c: Regenerated.
	 * generated/product_c16.c: Regenerated.
	 * generated/product_c4.c: Regenerated.
	 * generated/product_c8.c: Regenerated.
	 * generated/product_i1.c: Regenerated.
	 * generated/product_i16.c: Regenerated.
	 * generated/product_i2.c: Regenerated.
	 * generated/product_i4.c: Regenerated.
	 * generated/product_i8.c: Regenerated.
	 * generated/product_r10.c: Regenerated.
	 * generated/product_r16.c: Regenerated.
	 * generated/product_r4.c: Regenerated.
	 * generated/product_r8.c: Regenerated.
	 * generated/sum_c10.c: Regenerated.
	 * generated/sum_c16.c: Regenerated.
	 * generated/sum_c4.c: Regenerated.
	 * generated/sum_c8.c: Regenerated.
	 * generated/sum_i1.c: Regenerated.
	 * generated/sum_i16.c: Regenerated.
	 * generated/sum_i2.c: Regenerated.
	 * generated/sum_i4.c: Regenerated.
	 * generated/sum_i8.c: Regenerated.
	 * generated/sum_r10.c: Regenerated.
	 * generated/sum_r16.c: Regenerated.
	 * generated/sum_r4.c: Regenerated.
	 * generated/sum_r8.c: Regenerated.

diff --git a/libgfortran/m4/bessel.m4 b/libgfortran/m4/bessel.m4
index d5c602d..145ca0d 100644
--- a/libgfortran/m4/bessel.m4
+++ b/libgfortran/m4/bessel.m4
@@ -149,7 +149,6 @@ bessel_yn_r'rtype_kind` ('rtype` * const restrict ret, int n1, int n2,
       return;
     }
 
-  ret->base_addr = ret->base_addr;
   last1 = MATHFUNC(yn) (n1, x);
   ret->base_addr[0] = last1;
 
diff --git a/libgfortran/m4/ifunction.m4 b/libgfortran/m4/ifunction.m4
index 613fbf5..1555aeb 100644
--- a/libgfortran/m4/ifunction.m4
+++ b/libgfortran/m4/ifunction.m4
@@ -311,17 +311,12 @@ void
       {
 ')dnl
 define(START_MASKED_ARRAY_BLOCK,
-`	if (len <= 0)
-	  *dest = '$1`;
-	else
+`	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 ')dnl
 define(FINISH_MASKED_ARRAY_FUNCTION,
-`	      }
-	    *dest = result;
-	  }
+`	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
@@ -500,6 +495,6 @@ FINISH_ARRAY_FUNCTION($4)')dnl
 define(MASKED_ARRAY_FUNCTION,
 `START_MASKED_ARRAY_FUNCTION
 $2
-START_MASKED_ARRAY_BLOCK($1)
+START_MASKED_ARRAY_BLOCK
 $3
 FINISH_MASKED_ARRAY_FUNCTION')dnl
diff --git a/libgfortran/generated/bessel_r10.c b/libgfortran/generated/bessel_r10.c
index 6a3a139..cdfdac9 100644
--- a/libgfortran/generated/bessel_r10.c
+++ b/libgfortran/generated/bessel_r10.c
@@ -148,7 +148,6 @@ bessel_yn_r10 (gfc_array_r10 * const restrict ret, int n1, int n2,
       return;
     }
 
-  ret->base_addr = ret->base_addr;
   last1 = MATHFUNC(yn) (n1, x);
   ret->base_addr[0] = last1;
 
diff --git a/libgfortran/generated/bessel_r16.c b/libgfortran/generated/bessel_r16.c
index c1aa5e2..65a7bfb 100644
--- a/libgfortran/generated/bessel_r16.c
+++ b/libgfortran/generated/bessel_r16.c
@@ -152,7 +152,6 @@ bessel_yn_r16 (gfc_array_r16 * const restrict ret, int n1, int n2,
       return;
     }
 
-  ret->base_addr = ret->base_addr;
   last1 = MATHFUNC(yn) (n1, x);
   ret->base_addr[0] = last1;
 
diff --git a/libgfortran/generated/bessel_r4.c b/libgfortran/generated/bessel_r4.c
index 0f7c4cc..7dc967c 100644
--- a/libgfortran/generated/bessel_r4.c
+++ b/libgfortran/generated/bessel_r4.c
@@ -148,7 +148,6 @@ bessel_yn_r4 (gfc_array_r4 * const restrict ret, int n1, int n2,
       return;
     }
 
-  ret->base_addr = ret->base_addr;
   last1 = MATHFUNC(yn) (n1, x);
   ret->base_addr[0] = last1;
 
diff --git a/libgfortran/generated/bessel_r8.c b/libgfortran/generated/bessel_r8.c
index cc61300..031726d 100644
--- a/libgfortran/generated/bessel_r8.c
+++ b/libgfortran/generated/bessel_r8.c
@@ -148,7 +148,6 @@ bessel_yn_r8 (gfc_array_r8 * const restrict ret, int n1, int n2,
       return;
     }
 
-  ret->base_addr = ret->base_addr;
   last1 = MATHFUNC(yn) (n1, x);
   ret->base_addr[0] = last1;
 
diff --git a/libgfortran/generated/iall_i1.c b/libgfortran/generated/iall_i1.c
index dbe0fa7..039cfda 100644
--- a/libgfortran/generated/iall_i1.c
+++ b/libgfortran/generated/iall_i1.c
@@ -323,18 +323,13 @@ miall_i1 (gfc_array_i1 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result &= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/iall_i16.c b/libgfortran/generated/iall_i16.c
index 02e61fd..e41493d 100644
--- a/libgfortran/generated/iall_i16.c
+++ b/libgfortran/generated/iall_i16.c
@@ -323,18 +323,13 @@ miall_i16 (gfc_array_i16 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result &= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/iall_i2.c b/libgfortran/generated/iall_i2.c
index e9c181c..7d8e9ee 100644
--- a/libgfortran/generated/iall_i2.c
+++ b/libgfortran/generated/iall_i2.c
@@ -323,18 +323,13 @@ miall_i2 (gfc_array_i2 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result &= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/iall_i4.c b/libgfortran/generated/iall_i4.c
index 8cd3b3e..1ecc966 100644
--- a/libgfortran/generated/iall_i4.c
+++ b/libgfortran/generated/iall_i4.c
@@ -323,18 +323,13 @@ miall_i4 (gfc_array_i4 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result &= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/iall_i8.c b/libgfortran/generated/iall_i8.c
index 8e2bb1a..87ba710 100644
--- a/libgfortran/generated/iall_i8.c
+++ b/libgfortran/generated/iall_i8.c
@@ -323,18 +323,13 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result &= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/iany_i1.c b/libgfortran/generated/iany_i1.c
index 52b6f92..2c8b85f 100644
--- a/libgfortran/generated/iany_i1.c
+++ b/libgfortran/generated/iany_i1.c
@@ -323,18 +323,13 @@ miany_i1 (gfc_array_i1 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result |= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/iany_i16.c b/libgfortran/generated/iany_i16.c
index 9194aa5..1ad55dd 100644
--- a/libgfortran/generated/iany_i16.c
+++ b/libgfortran/generated/iany_i16.c
@@ -323,18 +323,13 @@ miany_i16 (gfc_array_i16 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result |= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/iany_i2.c b/libgfortran/generated/iany_i2.c
index dcad991..f9b3380 100644
--- a/libgfortran/generated/iany_i2.c
+++ b/libgfortran/generated/iany_i2.c
@@ -323,18 +323,13 @@ miany_i2 (gfc_array_i2 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result |= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/iany_i4.c b/libgfortran/generated/iany_i4.c
index 46a5d83..12aa4f0 100644
--- a/libgfortran/generated/iany_i4.c
+++ b/libgfortran/generated/iany_i4.c
@@ -323,18 +323,13 @@ miany_i4 (gfc_array_i4 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result |= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/iany_i8.c b/libgfortran/generated/iany_i8.c
index f0a2e90..ed5704f 100644
--- a/libgfortran/generated/iany_i8.c
+++ b/libgfortran/generated/iany_i8.c
@@ -323,18 +323,13 @@ miany_i8 (gfc_array_i8 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result |= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/iparity_i1.c b/libgfortran/generated/iparity_i1.c
index 00eb4bc..e7faa52 100644
--- a/libgfortran/generated/iparity_i1.c
+++ b/libgfortran/generated/iparity_i1.c
@@ -323,18 +323,13 @@ miparity_i1 (gfc_array_i1 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result ^= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/iparity_i16.c b/libgfortran/generated/iparity_i16.c
index 6caad71..48b26d9 100644
--- a/libgfortran/generated/iparity_i16.c
+++ b/libgfortran/generated/iparity_i16.c
@@ -323,18 +323,13 @@ miparity_i16 (gfc_array_i16 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result ^= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/iparity_i2.c b/libgfortran/generated/iparity_i2.c
index c44f908..6711a2c 100644
--- a/libgfortran/generated/iparity_i2.c
+++ b/libgfortran/generated/iparity_i2.c
@@ -323,18 +323,13 @@ miparity_i2 (gfc_array_i2 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result ^= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/iparity_i4.c b/libgfortran/generated/iparity_i4.c
index a7f76c8..242f6c7 100644
--- a/libgfortran/generated/iparity_i4.c
+++ b/libgfortran/generated/iparity_i4.c
@@ -323,18 +323,13 @@ miparity_i4 (gfc_array_i4 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result ^= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/iparity_i8.c b/libgfortran/generated/iparity_i8.c
index e93389d..aa15b91 100644
--- a/libgfortran/generated/iparity_i8.c
+++ b/libgfortran/generated/iparity_i8.c
@@ -323,18 +323,13 @@ miparity_i8 (gfc_array_i8 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result ^= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_i1.c b/libgfortran/generated/maxloc1_16_i1.c
index e2eb8e0..bec651f 100644
--- a/libgfortran/generated/maxloc1_16_i1.c
+++ b/libgfortran/generated/maxloc1_16_i1.c
@@ -354,12 +354,8 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_i16.c b/libgfortran/generated/maxloc1_16_i16.c
index 9b3563f..24d3de9 100644
--- a/libgfortran/generated/maxloc1_16_i16.c
+++ b/libgfortran/generated/maxloc1_16_i16.c
@@ -354,12 +354,8 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_i2.c b/libgfortran/generated/maxloc1_16_i2.c
index 0278e99..4236ab4 100644
--- a/libgfortran/generated/maxloc1_16_i2.c
+++ b/libgfortran/generated/maxloc1_16_i2.c
@@ -354,12 +354,8 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_i4.c b/libgfortran/generated/maxloc1_16_i4.c
index 9751c2a..133690e 100644
--- a/libgfortran/generated/maxloc1_16_i4.c
+++ b/libgfortran/generated/maxloc1_16_i4.c
@@ -354,12 +354,8 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_i8.c b/libgfortran/generated/maxloc1_16_i8.c
index e9140e5..7922dfd 100644
--- a/libgfortran/generated/maxloc1_16_i8.c
+++ b/libgfortran/generated/maxloc1_16_i8.c
@@ -354,12 +354,8 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_r10.c b/libgfortran/generated/maxloc1_16_r10.c
index f88d254..73ff493 100644
--- a/libgfortran/generated/maxloc1_16_r10.c
+++ b/libgfortran/generated/maxloc1_16_r10.c
@@ -354,12 +354,8 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_r16.c b/libgfortran/generated/maxloc1_16_r16.c
index b1188a2..952872a 100644
--- a/libgfortran/generated/maxloc1_16_r16.c
+++ b/libgfortran/generated/maxloc1_16_r16.c
@@ -354,12 +354,8 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_r4.c b/libgfortran/generated/maxloc1_16_r4.c
index 7061102..32c704a 100644
--- a/libgfortran/generated/maxloc1_16_r4.c
+++ b/libgfortran/generated/maxloc1_16_r4.c
@@ -354,12 +354,8 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_16_r8.c b/libgfortran/generated/maxloc1_16_r8.c
index 5d4d9c2..714591e 100644
--- a/libgfortran/generated/maxloc1_16_r8.c
+++ b/libgfortran/generated/maxloc1_16_r8.c
@@ -354,12 +354,8 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_i1.c b/libgfortran/generated/maxloc1_4_i1.c
index 0ee6ed5..9e8e8f0 100644
--- a/libgfortran/generated/maxloc1_4_i1.c
+++ b/libgfortran/generated/maxloc1_4_i1.c
@@ -354,12 +354,8 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_i16.c b/libgfortran/generated/maxloc1_4_i16.c
index c79f0ca..8987a55 100644
--- a/libgfortran/generated/maxloc1_4_i16.c
+++ b/libgfortran/generated/maxloc1_4_i16.c
@@ -354,12 +354,8 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_i2.c b/libgfortran/generated/maxloc1_4_i2.c
index 4eff28a..42c51c9 100644
--- a/libgfortran/generated/maxloc1_4_i2.c
+++ b/libgfortran/generated/maxloc1_4_i2.c
@@ -354,12 +354,8 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_i4.c b/libgfortran/generated/maxloc1_4_i4.c
index 7c8f5e6..4918340 100644
--- a/libgfortran/generated/maxloc1_4_i4.c
+++ b/libgfortran/generated/maxloc1_4_i4.c
@@ -354,12 +354,8 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_i8.c b/libgfortran/generated/maxloc1_4_i8.c
index ae63e1b..47b204d 100644
--- a/libgfortran/generated/maxloc1_4_i8.c
+++ b/libgfortran/generated/maxloc1_4_i8.c
@@ -354,12 +354,8 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_r10.c b/libgfortran/generated/maxloc1_4_r10.c
index afd935b..82de89c 100644
--- a/libgfortran/generated/maxloc1_4_r10.c
+++ b/libgfortran/generated/maxloc1_4_r10.c
@@ -354,12 +354,8 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_r16.c b/libgfortran/generated/maxloc1_4_r16.c
index fdd4817..4a4c54f 100644
--- a/libgfortran/generated/maxloc1_4_r16.c
+++ b/libgfortran/generated/maxloc1_4_r16.c
@@ -354,12 +354,8 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_r4.c b/libgfortran/generated/maxloc1_4_r4.c
index 8360dfc..5b1bf25 100644
--- a/libgfortran/generated/maxloc1_4_r4.c
+++ b/libgfortran/generated/maxloc1_4_r4.c
@@ -354,12 +354,8 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_4_r8.c b/libgfortran/generated/maxloc1_4_r8.c
index 96f3651..eafacb3 100644
--- a/libgfortran/generated/maxloc1_4_r8.c
+++ b/libgfortran/generated/maxloc1_4_r8.c
@@ -354,12 +354,8 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_i1.c b/libgfortran/generated/maxloc1_8_i1.c
index a591171..1483c7e 100644
--- a/libgfortran/generated/maxloc1_8_i1.c
+++ b/libgfortran/generated/maxloc1_8_i1.c
@@ -354,12 +354,8 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_i16.c b/libgfortran/generated/maxloc1_8_i16.c
index 30b946a..22806ba 100644
--- a/libgfortran/generated/maxloc1_8_i16.c
+++ b/libgfortran/generated/maxloc1_8_i16.c
@@ -354,12 +354,8 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_i2.c b/libgfortran/generated/maxloc1_8_i2.c
index af32584..04eadbf 100644
--- a/libgfortran/generated/maxloc1_8_i2.c
+++ b/libgfortran/generated/maxloc1_8_i2.c
@@ -354,12 +354,8 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_i4.c b/libgfortran/generated/maxloc1_8_i4.c
index dc63f1e..f686661 100644
--- a/libgfortran/generated/maxloc1_8_i4.c
+++ b/libgfortran/generated/maxloc1_8_i4.c
@@ -354,12 +354,8 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_i8.c b/libgfortran/generated/maxloc1_8_i8.c
index c50965e..714d3a7 100644
--- a/libgfortran/generated/maxloc1_8_i8.c
+++ b/libgfortran/generated/maxloc1_8_i8.c
@@ -354,12 +354,8 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_r10.c b/libgfortran/generated/maxloc1_8_r10.c
index c088686..0a07af5 100644
--- a/libgfortran/generated/maxloc1_8_r10.c
+++ b/libgfortran/generated/maxloc1_8_r10.c
@@ -354,12 +354,8 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_r16.c b/libgfortran/generated/maxloc1_8_r16.c
index 35f6807..8da4dd4 100644
--- a/libgfortran/generated/maxloc1_8_r16.c
+++ b/libgfortran/generated/maxloc1_8_r16.c
@@ -354,12 +354,8 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_r4.c b/libgfortran/generated/maxloc1_8_r4.c
index 5d84bd0..5c71e42 100644
--- a/libgfortran/generated/maxloc1_8_r4.c
+++ b/libgfortran/generated/maxloc1_8_r4.c
@@ -354,12 +354,8 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxloc1_8_r8.c b/libgfortran/generated/maxloc1_8_r8.c
index e1e80d3..3bdcdab 100644
--- a/libgfortran/generated/maxloc1_8_r8.c
+++ b/libgfortran/generated/maxloc1_8_r8.c
@@ -354,12 +354,8 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
 		    maxval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxval_i1.c b/libgfortran/generated/maxval_i1.c
index a94eeca..6e77368 100644
--- a/libgfortran/generated/maxval_i1.c
+++ b/libgfortran/generated/maxval_i1.c
@@ -344,12 +344,8 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
 #if defined (GFC_INTEGER_1_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = (-GFC_INTEGER_1_HUGE-1);
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_INTEGER_1_INFINITY) || defined (GFC_INTEGER_1_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
 #endif
 		if (*msrc && *src > result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxval_i16.c b/libgfortran/generated/maxval_i16.c
index 94059cb..e1cafc2 100644
--- a/libgfortran/generated/maxval_i16.c
+++ b/libgfortran/generated/maxval_i16.c
@@ -344,12 +344,8 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray,
 #if defined (GFC_INTEGER_16_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = (-GFC_INTEGER_16_HUGE-1);
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_INTEGER_16_INFINITY) || defined (GFC_INTEGER_16_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray,
 #endif
 		if (*msrc && *src > result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxval_i2.c b/libgfortran/generated/maxval_i2.c
index eb3d767..959ad43 100644
--- a/libgfortran/generated/maxval_i2.c
+++ b/libgfortran/generated/maxval_i2.c
@@ -344,12 +344,8 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
 #if defined (GFC_INTEGER_2_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = (-GFC_INTEGER_2_HUGE-1);
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_INTEGER_2_INFINITY) || defined (GFC_INTEGER_2_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
 #endif
 		if (*msrc && *src > result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxval_i4.c b/libgfortran/generated/maxval_i4.c
index ef9e6c9..698653b 100644
--- a/libgfortran/generated/maxval_i4.c
+++ b/libgfortran/generated/maxval_i4.c
@@ -344,12 +344,8 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
 #if defined (GFC_INTEGER_4_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = (-GFC_INTEGER_4_HUGE-1);
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_INTEGER_4_INFINITY) || defined (GFC_INTEGER_4_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
 #endif
 		if (*msrc && *src > result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxval_i8.c b/libgfortran/generated/maxval_i8.c
index a6cd682..9b4a033 100644
--- a/libgfortran/generated/maxval_i8.c
+++ b/libgfortran/generated/maxval_i8.c
@@ -344,12 +344,8 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
 #if defined (GFC_INTEGER_8_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = (-GFC_INTEGER_8_HUGE-1);
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_INTEGER_8_INFINITY) || defined (GFC_INTEGER_8_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
 #endif
 		if (*msrc && *src > result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxval_r10.c b/libgfortran/generated/maxval_r10.c
index 1be75f1..434096d 100644
--- a/libgfortran/generated/maxval_r10.c
+++ b/libgfortran/generated/maxval_r10.c
@@ -344,12 +344,8 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
 #if defined (GFC_REAL_10_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = -GFC_REAL_10_HUGE;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_REAL_10_INFINITY) || defined (GFC_REAL_10_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
 #endif
 		if (*msrc && *src > result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxval_r16.c b/libgfortran/generated/maxval_r16.c
index 059896d..0246e92 100644
--- a/libgfortran/generated/maxval_r16.c
+++ b/libgfortran/generated/maxval_r16.c
@@ -344,12 +344,8 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
 #if defined (GFC_REAL_16_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = -GFC_REAL_16_HUGE;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_REAL_16_INFINITY) || defined (GFC_REAL_16_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
 #endif
 		if (*msrc && *src > result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxval_r4.c b/libgfortran/generated/maxval_r4.c
index f306f18..d3e0c30 100644
--- a/libgfortran/generated/maxval_r4.c
+++ b/libgfortran/generated/maxval_r4.c
@@ -344,12 +344,8 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
 #if defined (GFC_REAL_4_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = -GFC_REAL_4_HUGE;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_REAL_4_INFINITY) || defined (GFC_REAL_4_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
 #endif
 		if (*msrc && *src > result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/maxval_r8.c b/libgfortran/generated/maxval_r8.c
index ca70ca5..b849baf 100644
--- a/libgfortran/generated/maxval_r8.c
+++ b/libgfortran/generated/maxval_r8.c
@@ -344,12 +344,8 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
 #if defined (GFC_REAL_8_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = -GFC_REAL_8_HUGE;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_REAL_8_INFINITY) || defined (GFC_REAL_8_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
 #endif
 		if (*msrc && *src > result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_16_i1.c b/libgfortran/generated/minloc1_16_i1.c
index 949fa43..a019c28 100644
--- a/libgfortran/generated/minloc1_16_i1.c
+++ b/libgfortran/generated/minloc1_16_i1.c
@@ -354,12 +354,8 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_16_i16.c b/libgfortran/generated/minloc1_16_i16.c
index b5a1681..54b250f 100644
--- a/libgfortran/generated/minloc1_16_i16.c
+++ b/libgfortran/generated/minloc1_16_i16.c
@@ -354,12 +354,8 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_16_i2.c b/libgfortran/generated/minloc1_16_i2.c
index 8879079..ef86efb 100644
--- a/libgfortran/generated/minloc1_16_i2.c
+++ b/libgfortran/generated/minloc1_16_i2.c
@@ -354,12 +354,8 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_16_i4.c b/libgfortran/generated/minloc1_16_i4.c
index 6a5553f..099b79d 100644
--- a/libgfortran/generated/minloc1_16_i4.c
+++ b/libgfortran/generated/minloc1_16_i4.c
@@ -354,12 +354,8 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_16_i8.c b/libgfortran/generated/minloc1_16_i8.c
index 04be9c6..db625d2 100644
--- a/libgfortran/generated/minloc1_16_i8.c
+++ b/libgfortran/generated/minloc1_16_i8.c
@@ -354,12 +354,8 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_16_r10.c b/libgfortran/generated/minloc1_16_r10.c
index a66feda..44f1679 100644
--- a/libgfortran/generated/minloc1_16_r10.c
+++ b/libgfortran/generated/minloc1_16_r10.c
@@ -354,12 +354,8 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_16_r16.c b/libgfortran/generated/minloc1_16_r16.c
index 2e75ecf..f62311e 100644
--- a/libgfortran/generated/minloc1_16_r16.c
+++ b/libgfortran/generated/minloc1_16_r16.c
@@ -354,12 +354,8 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_16_r4.c b/libgfortran/generated/minloc1_16_r4.c
index b8e9337..4aa3bf8 100644
--- a/libgfortran/generated/minloc1_16_r4.c
+++ b/libgfortran/generated/minloc1_16_r4.c
@@ -354,12 +354,8 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_16_r8.c b/libgfortran/generated/minloc1_16_r8.c
index 42519eb..ee07dee 100644
--- a/libgfortran/generated/minloc1_16_r8.c
+++ b/libgfortran/generated/minloc1_16_r8.c
@@ -354,12 +354,8 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
 	GFC_INTEGER_16 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_16)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_4_i1.c b/libgfortran/generated/minloc1_4_i1.c
index 07f0dce..9d26678 100644
--- a/libgfortran/generated/minloc1_4_i1.c
+++ b/libgfortran/generated/minloc1_4_i1.c
@@ -354,12 +354,8 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_4_i16.c b/libgfortran/generated/minloc1_4_i16.c
index 0c20411..2659a25 100644
--- a/libgfortran/generated/minloc1_4_i16.c
+++ b/libgfortran/generated/minloc1_4_i16.c
@@ -354,12 +354,8 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_4_i2.c b/libgfortran/generated/minloc1_4_i2.c
index 389b1db..27cb56a 100644
--- a/libgfortran/generated/minloc1_4_i2.c
+++ b/libgfortran/generated/minloc1_4_i2.c
@@ -354,12 +354,8 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_4_i4.c b/libgfortran/generated/minloc1_4_i4.c
index 5d66fe9..67f9084 100644
--- a/libgfortran/generated/minloc1_4_i4.c
+++ b/libgfortran/generated/minloc1_4_i4.c
@@ -354,12 +354,8 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_4_i8.c b/libgfortran/generated/minloc1_4_i8.c
index 28cd536..a5a66ee 100644
--- a/libgfortran/generated/minloc1_4_i8.c
+++ b/libgfortran/generated/minloc1_4_i8.c
@@ -354,12 +354,8 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_4_r10.c b/libgfortran/generated/minloc1_4_r10.c
index 3919671..7351db0 100644
--- a/libgfortran/generated/minloc1_4_r10.c
+++ b/libgfortran/generated/minloc1_4_r10.c
@@ -354,12 +354,8 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_4_r16.c b/libgfortran/generated/minloc1_4_r16.c
index f796612..2917650 100644
--- a/libgfortran/generated/minloc1_4_r16.c
+++ b/libgfortran/generated/minloc1_4_r16.c
@@ -354,12 +354,8 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_4_r4.c b/libgfortran/generated/minloc1_4_r4.c
index 7f34b91..d80c89a 100644
--- a/libgfortran/generated/minloc1_4_r4.c
+++ b/libgfortran/generated/minloc1_4_r4.c
@@ -354,12 +354,8 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_4_r8.c b/libgfortran/generated/minloc1_4_r8.c
index 21bb4cb..79dfbb3 100644
--- a/libgfortran/generated/minloc1_4_r8.c
+++ b/libgfortran/generated/minloc1_4_r8.c
@@ -354,12 +354,8 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
 	GFC_INTEGER_4 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_4)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_8_i1.c b/libgfortran/generated/minloc1_8_i1.c
index 81d6f8e..62e300b 100644
--- a/libgfortran/generated/minloc1_8_i1.c
+++ b/libgfortran/generated/minloc1_8_i1.c
@@ -354,12 +354,8 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_8_i16.c b/libgfortran/generated/minloc1_8_i16.c
index 0a41d17..56682c7 100644
--- a/libgfortran/generated/minloc1_8_i16.c
+++ b/libgfortran/generated/minloc1_8_i16.c
@@ -354,12 +354,8 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_8_i2.c b/libgfortran/generated/minloc1_8_i2.c
index b0dac3e..819da19 100644
--- a/libgfortran/generated/minloc1_8_i2.c
+++ b/libgfortran/generated/minloc1_8_i2.c
@@ -354,12 +354,8 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_8_i4.c b/libgfortran/generated/minloc1_8_i4.c
index c8b42ca..b59bc33 100644
--- a/libgfortran/generated/minloc1_8_i4.c
+++ b/libgfortran/generated/minloc1_8_i4.c
@@ -354,12 +354,8 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_8_i8.c b/libgfortran/generated/minloc1_8_i8.c
index 186fe5c..5caf88a 100644
--- a/libgfortran/generated/minloc1_8_i8.c
+++ b/libgfortran/generated/minloc1_8_i8.c
@@ -354,12 +354,8 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_8_r10.c b/libgfortran/generated/minloc1_8_r10.c
index 582f88e..068efbb 100644
--- a/libgfortran/generated/minloc1_8_r10.c
+++ b/libgfortran/generated/minloc1_8_r10.c
@@ -354,12 +354,8 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_8_r16.c b/libgfortran/generated/minloc1_8_r16.c
index 0471c27..09a3bed 100644
--- a/libgfortran/generated/minloc1_8_r16.c
+++ b/libgfortran/generated/minloc1_8_r16.c
@@ -354,12 +354,8 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_8_r4.c b/libgfortran/generated/minloc1_8_r4.c
index b144115..41b5b72 100644
--- a/libgfortran/generated/minloc1_8_r4.c
+++ b/libgfortran/generated/minloc1_8_r4.c
@@ -354,12 +354,8 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minloc1_8_r8.c b/libgfortran/generated/minloc1_8_r8.c
index 81916e2..4eb97b4 100644
--- a/libgfortran/generated/minloc1_8_r8.c
+++ b/libgfortran/generated/minloc1_8_r8.c
@@ -354,12 +354,8 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
 	GFC_INTEGER_8 result2 = 0;
 #endif
 	result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 		if (*msrc)
 		  {
@@ -387,9 +383,8 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
 		    minval = *src;
 		    result = (GFC_INTEGER_8)n + 1;
 		  }
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minval_i1.c b/libgfortran/generated/minval_i1.c
index e2abc95..461236e 100644
--- a/libgfortran/generated/minval_i1.c
+++ b/libgfortran/generated/minval_i1.c
@@ -344,12 +344,8 @@ mminval_i1 (gfc_array_i1 * const restrict retarray,
 #if defined (GFC_INTEGER_1_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = GFC_INTEGER_1_HUGE;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_INTEGER_1_INFINITY) || defined (GFC_INTEGER_1_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mminval_i1 (gfc_array_i1 * const restrict retarray,
 #endif
 		if (*msrc && *src < result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minval_i16.c b/libgfortran/generated/minval_i16.c
index f2c72e3..f32316d 100644
--- a/libgfortran/generated/minval_i16.c
+++ b/libgfortran/generated/minval_i16.c
@@ -344,12 +344,8 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
 #if defined (GFC_INTEGER_16_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = GFC_INTEGER_16_HUGE;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_INTEGER_16_INFINITY) || defined (GFC_INTEGER_16_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
 #endif
 		if (*msrc && *src < result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minval_i2.c b/libgfortran/generated/minval_i2.c
index b87a072..dd7bc21 100644
--- a/libgfortran/generated/minval_i2.c
+++ b/libgfortran/generated/minval_i2.c
@@ -344,12 +344,8 @@ mminval_i2 (gfc_array_i2 * const restrict retarray,
 #if defined (GFC_INTEGER_2_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = GFC_INTEGER_2_HUGE;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_INTEGER_2_INFINITY) || defined (GFC_INTEGER_2_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mminval_i2 (gfc_array_i2 * const restrict retarray,
 #endif
 		if (*msrc && *src < result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minval_i4.c b/libgfortran/generated/minval_i4.c
index 20766fa..33e9016e 100644
--- a/libgfortran/generated/minval_i4.c
+++ b/libgfortran/generated/minval_i4.c
@@ -344,12 +344,8 @@ mminval_i4 (gfc_array_i4 * const restrict retarray,
 #if defined (GFC_INTEGER_4_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = GFC_INTEGER_4_HUGE;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_INTEGER_4_INFINITY) || defined (GFC_INTEGER_4_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mminval_i4 (gfc_array_i4 * const restrict retarray,
 #endif
 		if (*msrc && *src < result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minval_i8.c b/libgfortran/generated/minval_i8.c
index 73e3d9b..165600c 100644
--- a/libgfortran/generated/minval_i8.c
+++ b/libgfortran/generated/minval_i8.c
@@ -344,12 +344,8 @@ mminval_i8 (gfc_array_i8 * const restrict retarray,
 #if defined (GFC_INTEGER_8_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = GFC_INTEGER_8_HUGE;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_INTEGER_8_INFINITY) || defined (GFC_INTEGER_8_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mminval_i8 (gfc_array_i8 * const restrict retarray,
 #endif
 		if (*msrc && *src < result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minval_r10.c b/libgfortran/generated/minval_r10.c
index 72134fe..9c77f08 100644
--- a/libgfortran/generated/minval_r10.c
+++ b/libgfortran/generated/minval_r10.c
@@ -344,12 +344,8 @@ mminval_r10 (gfc_array_r10 * const restrict retarray,
 #if defined (GFC_REAL_10_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = GFC_REAL_10_HUGE;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_REAL_10_INFINITY) || defined (GFC_REAL_10_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mminval_r10 (gfc_array_r10 * const restrict retarray,
 #endif
 		if (*msrc && *src < result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minval_r16.c b/libgfortran/generated/minval_r16.c
index 47c703c..dcfeab1 100644
--- a/libgfortran/generated/minval_r16.c
+++ b/libgfortran/generated/minval_r16.c
@@ -344,12 +344,8 @@ mminval_r16 (gfc_array_r16 * const restrict retarray,
 #if defined (GFC_REAL_16_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = GFC_REAL_16_HUGE;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_REAL_16_INFINITY) || defined (GFC_REAL_16_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mminval_r16 (gfc_array_r16 * const restrict retarray,
 #endif
 		if (*msrc && *src < result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minval_r4.c b/libgfortran/generated/minval_r4.c
index 58c8854..014471a 100644
--- a/libgfortran/generated/minval_r4.c
+++ b/libgfortran/generated/minval_r4.c
@@ -344,12 +344,8 @@ mminval_r4 (gfc_array_r4 * const restrict retarray,
 #if defined (GFC_REAL_4_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = GFC_REAL_4_HUGE;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_REAL_4_INFINITY) || defined (GFC_REAL_4_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mminval_r4 (gfc_array_r4 * const restrict retarray,
 #endif
 		if (*msrc && *src < result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/minval_r8.c b/libgfortran/generated/minval_r8.c
index c8426bd..5a93248 100644
--- a/libgfortran/generated/minval_r8.c
+++ b/libgfortran/generated/minval_r8.c
@@ -344,12 +344,8 @@ mminval_r8 (gfc_array_r8 * const restrict retarray,
 #if defined (GFC_REAL_8_QUIET_NAN)
 	int non_empty_p = 0;
 #endif
-	if (len <= 0)
-	  *dest = GFC_REAL_8_HUGE;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
 #if defined (GFC_REAL_8_INFINITY) || defined (GFC_REAL_8_QUIET_NAN)
 		if (*msrc)
@@ -374,9 +370,8 @@ mminval_r8 (gfc_array_r8 * const restrict retarray,
 #endif
 		if (*msrc && *src < result)
 		  result = *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/product_c10.c b/libgfortran/generated/product_c10.c
index 379f389..ede6ce8 100644
--- a/libgfortran/generated/product_c10.c
+++ b/libgfortran/generated/product_c10.c
@@ -323,18 +323,13 @@ mproduct_c10 (gfc_array_c10 * const restrict retarray,
       {
 
   result = 1;
-	if (len <= 0)
-	  *dest = 1;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result *= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/product_c16.c b/libgfortran/generated/product_c16.c
index 2e91c5e..f6ebf43 100644
--- a/libgfortran/generated/product_c16.c
+++ b/libgfortran/generated/product_c16.c
@@ -323,18 +323,13 @@ mproduct_c16 (gfc_array_c16 * const restrict retarray,
       {
 
   result = 1;
-	if (len <= 0)
-	  *dest = 1;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result *= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/product_c4.c b/libgfortran/generated/product_c4.c
index c1a9534..4bf17c3 100644
--- a/libgfortran/generated/product_c4.c
+++ b/libgfortran/generated/product_c4.c
@@ -323,18 +323,13 @@ mproduct_c4 (gfc_array_c4 * const restrict retarray,
       {
 
   result = 1;
-	if (len <= 0)
-	  *dest = 1;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result *= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/product_c8.c b/libgfortran/generated/product_c8.c
index 80a6ac6..0fe8ff1 100644
--- a/libgfortran/generated/product_c8.c
+++ b/libgfortran/generated/product_c8.c
@@ -323,18 +323,13 @@ mproduct_c8 (gfc_array_c8 * const restrict retarray,
       {
 
   result = 1;
-	if (len <= 0)
-	  *dest = 1;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result *= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/product_i1.c b/libgfortran/generated/product_i1.c
index ff8e76a..9ea1687 100644
--- a/libgfortran/generated/product_i1.c
+++ b/libgfortran/generated/product_i1.c
@@ -323,18 +323,13 @@ mproduct_i1 (gfc_array_i1 * const restrict retarray,
       {
 
   result = 1;
-	if (len <= 0)
-	  *dest = 1;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result *= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/product_i16.c b/libgfortran/generated/product_i16.c
index 652e766..62be1e4 100644
--- a/libgfortran/generated/product_i16.c
+++ b/libgfortran/generated/product_i16.c
@@ -323,18 +323,13 @@ mproduct_i16 (gfc_array_i16 * const restrict retarray,
       {
 
   result = 1;
-	if (len <= 0)
-	  *dest = 1;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result *= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/product_i2.c b/libgfortran/generated/product_i2.c
index 1063d6a..1785cbd 100644
--- a/libgfortran/generated/product_i2.c
+++ b/libgfortran/generated/product_i2.c
@@ -323,18 +323,13 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray,
       {
 
   result = 1;
-	if (len <= 0)
-	  *dest = 1;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result *= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/product_i4.c b/libgfortran/generated/product_i4.c
index 97eab9e..9c52a12 100644
--- a/libgfortran/generated/product_i4.c
+++ b/libgfortran/generated/product_i4.c
@@ -323,18 +323,13 @@ mproduct_i4 (gfc_array_i4 * const restrict retarray,
       {
 
   result = 1;
-	if (len <= 0)
-	  *dest = 1;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result *= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/product_i8.c b/libgfortran/generated/product_i8.c
index 8945497..8184020 100644
--- a/libgfortran/generated/product_i8.c
+++ b/libgfortran/generated/product_i8.c
@@ -323,18 +323,13 @@ mproduct_i8 (gfc_array_i8 * const restrict retarray,
       {
 
   result = 1;
-	if (len <= 0)
-	  *dest = 1;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result *= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/product_r10.c b/libgfortran/generated/product_r10.c
index 4259f7ac..324ce45 100644
--- a/libgfortran/generated/product_r10.c
+++ b/libgfortran/generated/product_r10.c
@@ -323,18 +323,13 @@ mproduct_r10 (gfc_array_r10 * const restrict retarray,
       {
 
   result = 1;
-	if (len <= 0)
-	  *dest = 1;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result *= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/product_r16.c b/libgfortran/generated/product_r16.c
index e4ec5b2..16cbaa1 100644
--- a/libgfortran/generated/product_r16.c
+++ b/libgfortran/generated/product_r16.c
@@ -323,18 +323,13 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray,
       {
 
   result = 1;
-	if (len <= 0)
-	  *dest = 1;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result *= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/product_r4.c b/libgfortran/generated/product_r4.c
index dc3fe51..38febae 100644
--- a/libgfortran/generated/product_r4.c
+++ b/libgfortran/generated/product_r4.c
@@ -323,18 +323,13 @@ mproduct_r4 (gfc_array_r4 * const restrict retarray,
       {
 
   result = 1;
-	if (len <= 0)
-	  *dest = 1;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result *= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/product_r8.c b/libgfortran/generated/product_r8.c
index 5e03477..ee61b64 100644
--- a/libgfortran/generated/product_r8.c
+++ b/libgfortran/generated/product_r8.c
@@ -323,18 +323,13 @@ mproduct_r8 (gfc_array_r8 * const restrict retarray,
       {
 
   result = 1;
-	if (len <= 0)
-	  *dest = 1;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result *= *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/sum_c10.c b/libgfortran/generated/sum_c10.c
index 50567b3..cbe6de5 100644
--- a/libgfortran/generated/sum_c10.c
+++ b/libgfortran/generated/sum_c10.c
@@ -323,18 +323,13 @@ msum_c10 (gfc_array_c10 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result += *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/sum_c16.c b/libgfortran/generated/sum_c16.c
index 285b444..37a080e 100644
--- a/libgfortran/generated/sum_c16.c
+++ b/libgfortran/generated/sum_c16.c
@@ -323,18 +323,13 @@ msum_c16 (gfc_array_c16 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result += *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/sum_c4.c b/libgfortran/generated/sum_c4.c
index bdaa1ad..bc08e2c 100644
--- a/libgfortran/generated/sum_c4.c
+++ b/libgfortran/generated/sum_c4.c
@@ -323,18 +323,13 @@ msum_c4 (gfc_array_c4 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result += *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/sum_c8.c b/libgfortran/generated/sum_c8.c
index e7a4a45..5f0f544 100644
--- a/libgfortran/generated/sum_c8.c
+++ b/libgfortran/generated/sum_c8.c
@@ -323,18 +323,13 @@ msum_c8 (gfc_array_c8 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result += *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/sum_i1.c b/libgfortran/generated/sum_i1.c
index 7b03bd0..737dc2d 100644
--- a/libgfortran/generated/sum_i1.c
+++ b/libgfortran/generated/sum_i1.c
@@ -323,18 +323,13 @@ msum_i1 (gfc_array_i1 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result += *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/sum_i16.c b/libgfortran/generated/sum_i16.c
index 71bf01a..34f0dad 100644
--- a/libgfortran/generated/sum_i16.c
+++ b/libgfortran/generated/sum_i16.c
@@ -323,18 +323,13 @@ msum_i16 (gfc_array_i16 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result += *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/sum_i2.c b/libgfortran/generated/sum_i2.c
index 1d82782..8c74899 100644
--- a/libgfortran/generated/sum_i2.c
+++ b/libgfortran/generated/sum_i2.c
@@ -323,18 +323,13 @@ msum_i2 (gfc_array_i2 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result += *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/sum_i4.c b/libgfortran/generated/sum_i4.c
index 3e29bfa..d9e1b37 100644
--- a/libgfortran/generated/sum_i4.c
+++ b/libgfortran/generated/sum_i4.c
@@ -323,18 +323,13 @@ msum_i4 (gfc_array_i4 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result += *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/sum_i8.c b/libgfortran/generated/sum_i8.c
index 05767bc..b0d38c6 100644
--- a/libgfortran/generated/sum_i8.c
+++ b/libgfortran/generated/sum_i8.c
@@ -323,18 +323,13 @@ msum_i8 (gfc_array_i8 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result += *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/sum_r10.c b/libgfortran/generated/sum_r10.c
index 16ff425..bd2574d 100644
--- a/libgfortran/generated/sum_r10.c
+++ b/libgfortran/generated/sum_r10.c
@@ -323,18 +323,13 @@ msum_r10 (gfc_array_r10 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result += *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/sum_r16.c b/libgfortran/generated/sum_r16.c
index 3b2d8a6..805e49e 100644
--- a/libgfortran/generated/sum_r16.c
+++ b/libgfortran/generated/sum_r16.c
@@ -323,18 +323,13 @@ msum_r16 (gfc_array_r16 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result += *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/sum_r4.c b/libgfortran/generated/sum_r4.c
index 5136dae..ec918c2 100644
--- a/libgfortran/generated/sum_r4.c
+++ b/libgfortran/generated/sum_r4.c
@@ -323,18 +323,13 @@ msum_r4 (gfc_array_r4 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result += *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
diff --git a/libgfortran/generated/sum_r8.c b/libgfortran/generated/sum_r8.c
index 8634637..3bf49fe 100644
--- a/libgfortran/generated/sum_r8.c
+++ b/libgfortran/generated/sum_r8.c
@@ -323,18 +323,13 @@ msum_r8 (gfc_array_r8 * const restrict retarray,
       {
 
   result = 0;
-	if (len <= 0)
-	  *dest = 0;
-	else
+	for (n = 0; n < len; n++, src += delta, msrc += mdelta)
 	  {
-	    for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-	      {
 
   if (*msrc)
     result += *src;
-	      }
-	    *dest = result;
 	  }
+	*dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
