summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog9
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_mmloc.f9017
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_mmval.f908
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_product.f909
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_sum.f9010
-rw-r--r--libgfortran/ChangeLog64
-rw-r--r--libgfortran/generated/maxloc0_4_i4.c3
-rw-r--r--libgfortran/generated/maxloc0_4_i8.c3
-rw-r--r--libgfortran/generated/maxloc0_4_r4.c3
-rw-r--r--libgfortran/generated/maxloc0_4_r8.c3
-rw-r--r--libgfortran/generated/maxloc0_8_i4.c3
-rw-r--r--libgfortran/generated/maxloc0_8_i8.c3
-rw-r--r--libgfortran/generated/maxloc0_8_r4.c3
-rw-r--r--libgfortran/generated/maxloc0_8_r8.c3
-rw-r--r--libgfortran/generated/maxloc1_4_i4.c3
-rw-r--r--libgfortran/generated/maxloc1_4_i8.c3
-rw-r--r--libgfortran/generated/maxloc1_4_r4.c3
-rw-r--r--libgfortran/generated/maxloc1_4_r8.c3
-rw-r--r--libgfortran/generated/maxloc1_8_i4.c3
-rw-r--r--libgfortran/generated/maxloc1_8_i8.c3
-rw-r--r--libgfortran/generated/maxloc1_8_r4.c3
-rw-r--r--libgfortran/generated/maxloc1_8_r8.c3
-rw-r--r--libgfortran/generated/maxval_i4.c3
-rw-r--r--libgfortran/generated/maxval_i8.c3
-rw-r--r--libgfortran/generated/maxval_r4.c3
-rw-r--r--libgfortran/generated/maxval_r8.c3
-rw-r--r--libgfortran/generated/minloc0_4_i4.c5
-rw-r--r--libgfortran/generated/minloc0_4_i8.c3
-rw-r--r--libgfortran/generated/minloc0_4_r4.c3
-rw-r--r--libgfortran/generated/minloc0_4_r8.c3
-rw-r--r--libgfortran/generated/minloc0_8_i4.c3
-rw-r--r--libgfortran/generated/minloc0_8_i8.c3
-rw-r--r--libgfortran/generated/minloc0_8_r4.c3
-rw-r--r--libgfortran/generated/minloc0_8_r8.c3
-rw-r--r--libgfortran/generated/minloc1_4_i4.c3
-rw-r--r--libgfortran/generated/minloc1_4_i8.c3
-rw-r--r--libgfortran/generated/minloc1_4_r4.c3
-rw-r--r--libgfortran/generated/minloc1_4_r8.c3
-rw-r--r--libgfortran/generated/minloc1_8_i4.c3
-rw-r--r--libgfortran/generated/minloc1_8_i8.c3
-rw-r--r--libgfortran/generated/minloc1_8_r4.c3
-rw-r--r--libgfortran/generated/minloc1_8_r8.c3
-rw-r--r--libgfortran/generated/minval_i4.c3
-rw-r--r--libgfortran/generated/minval_i8.c3
-rw-r--r--libgfortran/generated/minval_r4.c3
-rw-r--r--libgfortran/generated/minval_r8.c3
-rw-r--r--libgfortran/generated/product_c4.c3
-rw-r--r--libgfortran/generated/product_c8.c3
-rw-r--r--libgfortran/generated/product_i4.c3
-rw-r--r--libgfortran/generated/product_i8.c3
-rw-r--r--libgfortran/generated/product_r4.c3
-rw-r--r--libgfortran/generated/product_r8.c3
-rw-r--r--libgfortran/generated/sum_c4.c3
-rw-r--r--libgfortran/generated/sum_c8.c3
-rw-r--r--libgfortran/generated/sum_i4.c3
-rw-r--r--libgfortran/generated/sum_i8.c3
-rw-r--r--libgfortran/generated/sum_r4.c3
-rw-r--r--libgfortran/generated/sum_r8.c3
-rw-r--r--libgfortran/m4/iforeach.m48
-rw-r--r--libgfortran/m4/ifunction.m49
60 files changed, 287 insertions, 5 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3edefec3c8e..6c1d8c4b545 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2005-04-13 Thomas Koenig <Thomas.Koenig@online.de>
+
+ PR libfortran/19016
+ * gfortran.fortran-torture/execute/intrinsic_mmloc.f90:
+ Add tests with mask generated by expression.
+ * gfortran.fortran-torture/execute/intrinsic_mmval.f90: Likewise.
+ * gfortran.fortran-torture/execute/intrinsic_product.f90: Likewise.
+ * gfortran.fortran-torture/execute/intrinsic_sum.f90: Likewise.
+
2005-04-12 Ulrich Weigand <uweigand@de.ibm.com>
PR middle-end/20917
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_mmloc.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_mmloc.f90
index ea73913b6ef..03273e1b22c 100644
--- a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_mmloc.f90
+++ b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_mmloc.f90
@@ -3,11 +3,12 @@ program testmmloc
implicit none
integer, dimension (3, 3) :: a
integer, dimension (3) :: b
- logical, dimension (3, 3) :: m
+ logical, dimension (3, 3) :: m, tr
integer i
character(len=10) line
a = reshape ((/1, 2, 3, 5, 4, 6, 9, 8, 7/), (/3, 3/));
+ tr = .true.
b = minloc (a, 1)
if (b(1) .ne. 1) call abort
@@ -27,6 +28,10 @@ program testmmloc
if (b(1) .ne. 2) call abort
if (b(2) .ne. 2) call abort
if (b(3) .ne. 3) call abort
+ b = minloc (a, 1, m .and. tr)
+ if (b(1) .ne. 2) call abort
+ if (b(2) .ne. 2) call abort
+ if (b(3) .ne. 3) call abort
b = -1
write (line, 9000) minloc(a, 1, m)
read (line, 9000) b
@@ -47,6 +52,9 @@ program testmmloc
b(1:2) = minloc(a, mask=m)
if (b(1) .ne. 2) call abort
if (b(2) .ne. 1) call abort
+ b(1:2) = minloc(a, mask=m .and. tr)
+ if (b(1) .ne. 2) call abort
+ if (b(2) .ne. 1) call abort
b = -1
write (line, 9000) minloc(a, mask=m)
read (line, 9000) b
@@ -72,6 +80,10 @@ program testmmloc
if (b(1) .ne. 3) call abort
if (b(2) .ne. 3) call abort
if (b(3) .ne. 2) call abort
+ b = maxloc (a, 1, m .and. tr)
+ if (b(1) .ne. 3) call abort
+ if (b(2) .ne. 3) call abort
+ if (b(3) .ne. 2) call abort
b = -1
write (line, 9000) maxloc(a, 1, m)
read (line, 9000) b
@@ -91,6 +103,9 @@ program testmmloc
b(1:2) = maxloc(a, mask=m)
if (b(1) .ne. 2) call abort
if (b(2) .ne. 3) call abort
+ b(1:2) = maxloc(a, mask=m .and. tr)
+ if (b(1) .ne. 2) call abort
+ if (b(2) .ne. 3) call abort
b = -1
write (line, 9000) maxloc(a, mask=m)
read (line, 9000) b
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_mmval.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_mmval.f90
index 86ec1591727..cfd1a5b2d74 100644
--- a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_mmval.f90
+++ b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_mmval.f90
@@ -3,12 +3,14 @@ program testmmval
implicit none
integer, dimension (3, 3) :: a
integer, dimension (3) :: b
- logical, dimension (3, 3) :: m
+ logical, dimension (3, 3) :: m, tr
integer i
character (len=9) line
a = reshape ((/1, 2, 3, 5, 4, 6, 9, 8, 7/), (/3, 3/));
+ tr = .true.
+
b = minval (a, 1)
if (any(b .ne. (/1, 4, 7/))) call abort
write (line, 9000) minval (a, 1)
@@ -19,6 +21,8 @@ program testmmval
m(1, 2) = .false.
b = minval (a, 1, m)
if (any(b .ne. (/2, 4, 7/))) call abort
+ b = minval (a, 1, m .and. tr)
+ if (any(b .ne. (/2, 4, 7/))) call abort
write (line, 9000) minval(a, 1, m)
if (line .ne. ' 2 4 7') call abort
@@ -32,6 +36,8 @@ program testmmval
m(1, 3) = .false.
b = maxval (a, 1, m)
if (any(b .ne. (/3, 6, 8/))) call abort
+ b = maxval (a, 1, m .and. tr)
+ if (any(b .ne. (/3, 6, 8/))) call abort
write (line, 9000) maxval(a, 1, m)
if (line .ne. ' 3 6 8') call abort
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_product.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_product.f90
index 2892d5407ca..6ada0a42191 100644
--- a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_product.f90
+++ b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_product.f90
@@ -3,13 +3,15 @@ program testproduct
implicit none
integer, dimension (3, 3) :: a
integer, dimension (3) :: b
- logical, dimension (3, 3) :: m
+ logical, dimension (3, 3) :: m, tr
character(len=12) line
a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/));
b = product (a, 1)
+ tr = .true.
+
if (any(b .ne. (/6, 120, 504/))) call abort
write (line, 9000) product(a,1)
@@ -23,8 +25,11 @@ program testproduct
m = .true.
m(1, 1) = .false.
m(2, 1) = .false.
+
b = product (a, 2, m)
+ if (any(b .ne. (/28, 40, 162/))) call abort
+ b = product (a, 2, m .and. tr)
if (any(b .ne. (/28, 40, 162/))) call abort
write (line, 9000) product(a, 2, m)
@@ -32,6 +37,8 @@ program testproduct
if (product (a, mask=m) .ne. 181440) call abort
+ if (product (a, mask=m .and. tr) .ne. 181440) call abort
+
write (line, 9010) product(a, mask=m)
if (line .ne. '181440') call abort
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_sum.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_sum.f90
index 552f6c6d01f..879fa0320dd 100644
--- a/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_sum.f90
+++ b/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_sum.f90
@@ -3,12 +3,14 @@ program testforall
implicit none
integer, dimension (3, 3) :: a
integer, dimension (3) :: b
- logical, dimension (3, 3) :: m
+ logical, dimension (3, 3) :: m, tr
integer i
character(len=9) line
a = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/));
+ tr = .true.
+
if (sum(a) .ne. 45) call abort
write (line, 9000) sum(a)
if (line .ne. ' 45 ') call abort
@@ -24,6 +26,7 @@ program testforall
m(2, 1) = .false.
if (sum (a, mask=m) .ne. 42) call abort
+ if (sum (a, mask=m .and. tr) .ne. 42) call abort
write(line, 9000) sum (a, mask=m)
if (line .ne. ' 42 ') call abort
@@ -32,6 +35,11 @@ program testforall
if (b(1) .ne. 11) call abort
if (b(2) .ne. 13) call abort
if (b(3) .ne. 18) call abort
+
+ b = sum (a, 2, m .and. tr)
+ if (b(1) .ne. 11) call abort
+ if (b(2) .ne. 13) call abort
+ if (b(3) .ne. 18) call abort
write (line, 9000) sum (a, 2, m)
if (line .ne. ' 11 13 18') call abort
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index ca2120d26f5..327d42d6f22 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,67 @@
+2005-04-13 Thomas Koenig <Thomas.Koenig@online.de>
+
+ PR libfortran/19106
+ * m4/iforeach.c (name`'rtype_qual`_'atype_code): Add TODO
+ that setting correct strides is a front end job.
+ (`m'name`'rtype_qual`_'atype_code): Likewise. If mask has
+ a lowest stride of 0, adjust to 1.
+ * m4/ifunction.c (name`'rtype_qual`_'atype_code): Add TODO
+ that setting correct strides is a front end job.
+ (`m'name`'rtype_qual`_'atype_code): Likewise. If mask has
+ a lowest stride of 0, adjust to 1.
+ * maxloc0_4_i4.c: Regenerated
+ * maxloc0_4_i8.c: Regenerated
+ * maxloc0_4_r4.c: Regenerated
+ * maxloc0_4_r8.c: Regenerated
+ * maxloc0_8_i4.c: Regenerated
+ * maxloc0_8_i8.c: Regenerated
+ * maxloc0_8_r4.c: Regenerated
+ * maxloc0_8_r8.c: Regenerated
+ * maxloc1_4_i4.c: Regenerated
+ * maxloc1_4_i8.c: Regenerated
+ * maxloc1_4_r4.c: Regenerated
+ * maxloc1_4_r8.c: Regenerated
+ * maxloc1_8_i4.c: Regenerated
+ * maxloc1_8_i8.c: Regenerated
+ * maxloc1_8_r4.c: Regenerated
+ * maxloc1_8_r8.c: Regenerated
+ * maxval_i4.c: Regenerated
+ * maxval_i8.c: Regenerated
+ * maxval_r4.c: Regenerated
+ * maxval_r8.c: Regenerated
+ * minloc0_4_i4.c: Regenerated
+ * minloc0_4_i8.c: Regenerated
+ * minloc0_4_r4.c: Regenerated
+ * minloc0_4_r8.c: Regenerated
+ * minloc0_8_i4.c: Regenerated
+ * minloc0_8_i8.c: Regenerated
+ * minloc0_8_r4.c: Regenerated
+ * minloc0_8_r8.c: Regenerated
+ * minloc1_4_i4.c: Regenerated
+ * minloc1_4_i8.c: Regenerated
+ * minloc1_4_r4.c: Regenerated
+ * minloc1_4_r8.c: Regenerated
+ * minloc1_8_i4.c: Regenerated
+ * minloc1_8_i8.c: Regenerated
+ * minloc1_8_r4.c: Regenerated
+ * minloc1_8_r8.c: Regenerated
+ * minval_i4.c: Regenerated
+ * minval_i8.c: Regenerated
+ * minval_r4.c: Regenerated
+ * minval_r8.c: Regenerated
+ * product_c4.c: Regenerated
+ * product_c8.c: Regenerated
+ * product_i4.c: Regenerated
+ * product_i8.c: Regenerated
+ * product_r4.c: Regenerated
+ * product_r8.c: Regenerated
+ * sum_c4.c: Regenerated
+ * sum_c8.c: Regenerated
+ * sum_i4.c: Regenerated
+ * sum_i8.c: Regenerated
+ * sum_r4.c: Regenerated
+ * sum_r8.c: Regenerated
+
2005-04-10 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/20788
diff --git a/libgfortran/generated/maxloc0_4_i4.c b/libgfortran/generated/maxloc0_4_i4.c
index a483c432234..94e2ec554bf 100644
--- a/libgfortran/generated/maxloc0_4_i4.c
+++ b/libgfortran/generated/maxloc0_4_i4.c
@@ -195,6 +195,9 @@ mmaxloc0_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_4_i8.c b/libgfortran/generated/maxloc0_4_i8.c
index ced6d6a2fe1..85e0ea5c73e 100644
--- a/libgfortran/generated/maxloc0_4_i8.c
+++ b/libgfortran/generated/maxloc0_4_i8.c
@@ -195,6 +195,9 @@ mmaxloc0_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_4_r4.c b/libgfortran/generated/maxloc0_4_r4.c
index 06eb04c31e6..14f64e4d9bf 100644
--- a/libgfortran/generated/maxloc0_4_r4.c
+++ b/libgfortran/generated/maxloc0_4_r4.c
@@ -195,6 +195,9 @@ mmaxloc0_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_4_r8.c b/libgfortran/generated/maxloc0_4_r8.c
index 791321815bb..caa3388e490 100644
--- a/libgfortran/generated/maxloc0_4_r8.c
+++ b/libgfortran/generated/maxloc0_4_r8.c
@@ -195,6 +195,9 @@ mmaxloc0_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_8_i4.c b/libgfortran/generated/maxloc0_8_i4.c
index 49d370d7323..6999ffab0f5 100644
--- a/libgfortran/generated/maxloc0_8_i4.c
+++ b/libgfortran/generated/maxloc0_8_i4.c
@@ -195,6 +195,9 @@ mmaxloc0_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_8_i8.c b/libgfortran/generated/maxloc0_8_i8.c
index 100c011d967..614e6dfcd4f 100644
--- a/libgfortran/generated/maxloc0_8_i8.c
+++ b/libgfortran/generated/maxloc0_8_i8.c
@@ -195,6 +195,9 @@ mmaxloc0_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_8_r4.c b/libgfortran/generated/maxloc0_8_r4.c
index 4cf8364d882..b9e19501572 100644
--- a/libgfortran/generated/maxloc0_8_r4.c
+++ b/libgfortran/generated/maxloc0_8_r4.c
@@ -195,6 +195,9 @@ mmaxloc0_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc0_8_r8.c b/libgfortran/generated/maxloc0_8_r8.c
index 1a0cceee555..b7e216b8452 100644
--- a/libgfortran/generated/maxloc0_8_r8.c
+++ b/libgfortran/generated/maxloc0_8_r8.c
@@ -195,6 +195,9 @@ mmaxloc0_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/maxloc1_4_i4.c b/libgfortran/generated/maxloc1_4_i4.c
index 38c6836aa3d..deeb06382e0 100644
--- a/libgfortran/generated/maxloc1_4_i4.c
+++ b/libgfortran/generated/maxloc1_4_i4.c
@@ -200,6 +200,9 @@ mmaxloc1_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/maxloc1_4_i8.c b/libgfortran/generated/maxloc1_4_i8.c
index 9c6c7320255..80555e817f8 100644
--- a/libgfortran/generated/maxloc1_4_i8.c
+++ b/libgfortran/generated/maxloc1_4_i8.c
@@ -200,6 +200,9 @@ mmaxloc1_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/maxloc1_4_r4.c b/libgfortran/generated/maxloc1_4_r4.c
index 4048d2bc65a..55d52291a9b 100644
--- a/libgfortran/generated/maxloc1_4_r4.c
+++ b/libgfortran/generated/maxloc1_4_r4.c
@@ -200,6 +200,9 @@ mmaxloc1_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/maxloc1_4_r8.c b/libgfortran/generated/maxloc1_4_r8.c
index f27a1df4137..aab24a16834 100644
--- a/libgfortran/generated/maxloc1_4_r8.c
+++ b/libgfortran/generated/maxloc1_4_r8.c
@@ -200,6 +200,9 @@ mmaxloc1_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/maxloc1_8_i4.c b/libgfortran/generated/maxloc1_8_i4.c
index 448c9f9bd16..807be639840 100644
--- a/libgfortran/generated/maxloc1_8_i4.c
+++ b/libgfortran/generated/maxloc1_8_i4.c
@@ -200,6 +200,9 @@ mmaxloc1_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/maxloc1_8_i8.c b/libgfortran/generated/maxloc1_8_i8.c
index fb91a6a05ce..e86cd089031 100644
--- a/libgfortran/generated/maxloc1_8_i8.c
+++ b/libgfortran/generated/maxloc1_8_i8.c
@@ -200,6 +200,9 @@ mmaxloc1_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/maxloc1_8_r4.c b/libgfortran/generated/maxloc1_8_r4.c
index 33159fb28b3..584bfb4a611 100644
--- a/libgfortran/generated/maxloc1_8_r4.c
+++ b/libgfortran/generated/maxloc1_8_r4.c
@@ -200,6 +200,9 @@ mmaxloc1_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/maxloc1_8_r8.c b/libgfortran/generated/maxloc1_8_r8.c
index b1f780567da..60c8c3d3ce6 100644
--- a/libgfortran/generated/maxloc1_8_r8.c
+++ b/libgfortran/generated/maxloc1_8_r8.c
@@ -200,6 +200,9 @@ mmaxloc1_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/maxval_i4.c b/libgfortran/generated/maxval_i4.c
index e992327dd22..0bf088f044e 100644
--- a/libgfortran/generated/maxval_i4.c
+++ b/libgfortran/generated/maxval_i4.c
@@ -194,6 +194,9 @@ mmaxval_i4 (gfc_array_i4 * retarray, gfc_array_i4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/maxval_i8.c b/libgfortran/generated/maxval_i8.c
index 3e603771553..2acdef9b09e 100644
--- a/libgfortran/generated/maxval_i8.c
+++ b/libgfortran/generated/maxval_i8.c
@@ -194,6 +194,9 @@ mmaxval_i8 (gfc_array_i8 * retarray, gfc_array_i8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/maxval_r4.c b/libgfortran/generated/maxval_r4.c
index 8e94efbfe91..46948b96090 100644
--- a/libgfortran/generated/maxval_r4.c
+++ b/libgfortran/generated/maxval_r4.c
@@ -194,6 +194,9 @@ mmaxval_r4 (gfc_array_r4 * retarray, gfc_array_r4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/maxval_r8.c b/libgfortran/generated/maxval_r8.c
index 40a3575a793..b7bb89ce42c 100644
--- a/libgfortran/generated/maxval_r8.c
+++ b/libgfortran/generated/maxval_r8.c
@@ -194,6 +194,9 @@ mmaxval_r8 (gfc_array_r8 * retarray, gfc_array_r8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/minloc0_4_i4.c b/libgfortran/generated/minloc0_4_i4.c
index 178bf5af5df..4bb7a5a058d 100644
--- a/libgfortran/generated/minloc0_4_i4.c
+++ b/libgfortran/generated/minloc0_4_i4.c
@@ -195,6 +195,9 @@ mminloc0_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
@@ -238,7 +241,7 @@ mminloc0_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array,
{
{
/* Implementation start. */
-
+ printf("mbase = %p, *mbase = %d, *base=%d\n");
if (*mbase && *base < minval)
{
minval = *base;
diff --git a/libgfortran/generated/minloc0_4_i8.c b/libgfortran/generated/minloc0_4_i8.c
index d87a444c96c..9d7a1a4c599 100644
--- a/libgfortran/generated/minloc0_4_i8.c
+++ b/libgfortran/generated/minloc0_4_i8.c
@@ -195,6 +195,9 @@ mminloc0_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_4_r4.c b/libgfortran/generated/minloc0_4_r4.c
index 21c9edf451e..3b54a3ba35a 100644
--- a/libgfortran/generated/minloc0_4_r4.c
+++ b/libgfortran/generated/minloc0_4_r4.c
@@ -195,6 +195,9 @@ mminloc0_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_4_r8.c b/libgfortran/generated/minloc0_4_r8.c
index a00d0135e87..9866538a54c 100644
--- a/libgfortran/generated/minloc0_4_r8.c
+++ b/libgfortran/generated/minloc0_4_r8.c
@@ -195,6 +195,9 @@ mminloc0_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_8_i4.c b/libgfortran/generated/minloc0_8_i4.c
index 340c54d8aee..4440a9b5306 100644
--- a/libgfortran/generated/minloc0_8_i4.c
+++ b/libgfortran/generated/minloc0_8_i4.c
@@ -195,6 +195,9 @@ mminloc0_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_8_i8.c b/libgfortran/generated/minloc0_8_i8.c
index 5941eb4c4b1..f2ee93ca544 100644
--- a/libgfortran/generated/minloc0_8_i8.c
+++ b/libgfortran/generated/minloc0_8_i8.c
@@ -195,6 +195,9 @@ mminloc0_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_8_r4.c b/libgfortran/generated/minloc0_8_r4.c
index 9900bc98ed5..1f38c912aa6 100644
--- a/libgfortran/generated/minloc0_8_r4.c
+++ b/libgfortran/generated/minloc0_8_r4.c
@@ -195,6 +195,9 @@ mminloc0_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc0_8_r8.c b/libgfortran/generated/minloc0_8_r8.c
index d1caf2a181c..773ab48ee29 100644
--- a/libgfortran/generated/minloc0_8_r8.c
+++ b/libgfortran/generated/minloc0_8_r8.c
@@ -195,6 +195,9 @@ mminloc0_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/generated/minloc1_4_i4.c b/libgfortran/generated/minloc1_4_i4.c
index 76f082ba613..8c99d8391b2 100644
--- a/libgfortran/generated/minloc1_4_i4.c
+++ b/libgfortran/generated/minloc1_4_i4.c
@@ -200,6 +200,9 @@ mminloc1_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/minloc1_4_i8.c b/libgfortran/generated/minloc1_4_i8.c
index 358b4fa88b4..48596a61001 100644
--- a/libgfortran/generated/minloc1_4_i8.c
+++ b/libgfortran/generated/minloc1_4_i8.c
@@ -200,6 +200,9 @@ mminloc1_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/minloc1_4_r4.c b/libgfortran/generated/minloc1_4_r4.c
index b61e6b5bb0f..0b9d15c1fa8 100644
--- a/libgfortran/generated/minloc1_4_r4.c
+++ b/libgfortran/generated/minloc1_4_r4.c
@@ -200,6 +200,9 @@ mminloc1_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/minloc1_4_r8.c b/libgfortran/generated/minloc1_4_r8.c
index 65c1fac6e28..25d366a9439 100644
--- a/libgfortran/generated/minloc1_4_r8.c
+++ b/libgfortran/generated/minloc1_4_r8.c
@@ -200,6 +200,9 @@ mminloc1_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/minloc1_8_i4.c b/libgfortran/generated/minloc1_8_i4.c
index a428c919c6c..a57efe6ffc7 100644
--- a/libgfortran/generated/minloc1_8_i4.c
+++ b/libgfortran/generated/minloc1_8_i4.c
@@ -200,6 +200,9 @@ mminloc1_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/minloc1_8_i8.c b/libgfortran/generated/minloc1_8_i8.c
index fd7f8d6147f..5e1603a3a1b 100644
--- a/libgfortran/generated/minloc1_8_i8.c
+++ b/libgfortran/generated/minloc1_8_i8.c
@@ -200,6 +200,9 @@ mminloc1_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/minloc1_8_r4.c b/libgfortran/generated/minloc1_8_r4.c
index 0f15fc44c81..643765a4881 100644
--- a/libgfortran/generated/minloc1_8_r4.c
+++ b/libgfortran/generated/minloc1_8_r4.c
@@ -200,6 +200,9 @@ mminloc1_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/minloc1_8_r8.c b/libgfortran/generated/minloc1_8_r8.c
index edd9a7191e6..7d2dc4175a6 100644
--- a/libgfortran/generated/minloc1_8_r8.c
+++ b/libgfortran/generated/minloc1_8_r8.c
@@ -200,6 +200,9 @@ mminloc1_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/minval_i4.c b/libgfortran/generated/minval_i4.c
index 69330111b9a..d0a8a5ea4ad 100644
--- a/libgfortran/generated/minval_i4.c
+++ b/libgfortran/generated/minval_i4.c
@@ -194,6 +194,9 @@ mminval_i4 (gfc_array_i4 * retarray, gfc_array_i4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/minval_i8.c b/libgfortran/generated/minval_i8.c
index 579e5f97181..9d44514c4c6 100644
--- a/libgfortran/generated/minval_i8.c
+++ b/libgfortran/generated/minval_i8.c
@@ -194,6 +194,9 @@ mminval_i8 (gfc_array_i8 * retarray, gfc_array_i8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/minval_r4.c b/libgfortran/generated/minval_r4.c
index d936e2c871e..4220d8755eb 100644
--- a/libgfortran/generated/minval_r4.c
+++ b/libgfortran/generated/minval_r4.c
@@ -194,6 +194,9 @@ mminval_r4 (gfc_array_r4 * retarray, gfc_array_r4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/minval_r8.c b/libgfortran/generated/minval_r8.c
index a85e29efae2..d6c5b000eea 100644
--- a/libgfortran/generated/minval_r8.c
+++ b/libgfortran/generated/minval_r8.c
@@ -194,6 +194,9 @@ mminval_r8 (gfc_array_r8 * retarray, gfc_array_r8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/product_c4.c b/libgfortran/generated/product_c4.c
index 29604708812..d20ad9b8440 100644
--- a/libgfortran/generated/product_c4.c
+++ b/libgfortran/generated/product_c4.c
@@ -192,6 +192,9 @@ mproduct_c4 (gfc_array_c4 * retarray, gfc_array_c4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/product_c8.c b/libgfortran/generated/product_c8.c
index fc3eccb1110..706e9737de8 100644
--- a/libgfortran/generated/product_c8.c
+++ b/libgfortran/generated/product_c8.c
@@ -192,6 +192,9 @@ mproduct_c8 (gfc_array_c8 * retarray, gfc_array_c8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/product_i4.c b/libgfortran/generated/product_i4.c
index d349b66b118..f8f86d6ca82 100644
--- a/libgfortran/generated/product_i4.c
+++ b/libgfortran/generated/product_i4.c
@@ -192,6 +192,9 @@ mproduct_i4 (gfc_array_i4 * retarray, gfc_array_i4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/product_i8.c b/libgfortran/generated/product_i8.c
index 1fe07458e0b..00ae28bd1bf 100644
--- a/libgfortran/generated/product_i8.c
+++ b/libgfortran/generated/product_i8.c
@@ -192,6 +192,9 @@ mproduct_i8 (gfc_array_i8 * retarray, gfc_array_i8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/product_r4.c b/libgfortran/generated/product_r4.c
index 592210d7705..ea377bbdcbb 100644
--- a/libgfortran/generated/product_r4.c
+++ b/libgfortran/generated/product_r4.c
@@ -192,6 +192,9 @@ mproduct_r4 (gfc_array_r4 * retarray, gfc_array_r4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/product_r8.c b/libgfortran/generated/product_r8.c
index 922bcbe834e..58d22cfb5be 100644
--- a/libgfortran/generated/product_r8.c
+++ b/libgfortran/generated/product_r8.c
@@ -192,6 +192,9 @@ mproduct_r8 (gfc_array_r8 * retarray, gfc_array_r8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/sum_c4.c b/libgfortran/generated/sum_c4.c
index 74efd07c65b..d9b36d8201f 100644
--- a/libgfortran/generated/sum_c4.c
+++ b/libgfortran/generated/sum_c4.c
@@ -192,6 +192,9 @@ msum_c4 (gfc_array_c4 * retarray, gfc_array_c4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/sum_c8.c b/libgfortran/generated/sum_c8.c
index 7d688104d55..a5c44cdcf03 100644
--- a/libgfortran/generated/sum_c8.c
+++ b/libgfortran/generated/sum_c8.c
@@ -192,6 +192,9 @@ msum_c8 (gfc_array_c8 * retarray, gfc_array_c8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/sum_i4.c b/libgfortran/generated/sum_i4.c
index 01b41126746..b10798f847c 100644
--- a/libgfortran/generated/sum_i4.c
+++ b/libgfortran/generated/sum_i4.c
@@ -192,6 +192,9 @@ msum_i4 (gfc_array_i4 * retarray, gfc_array_i4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/sum_i8.c b/libgfortran/generated/sum_i8.c
index df882c8137e..0d3e1913ac4 100644
--- a/libgfortran/generated/sum_i8.c
+++ b/libgfortran/generated/sum_i8.c
@@ -192,6 +192,9 @@ msum_i8 (gfc_array_i8 * retarray, gfc_array_i8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/sum_r4.c b/libgfortran/generated/sum_r4.c
index d88384dc908..c0a81d5cb0a 100644
--- a/libgfortran/generated/sum_r4.c
+++ b/libgfortran/generated/sum_r4.c
@@ -192,6 +192,9 @@ msum_r4 (gfc_array_r4 * retarray, gfc_array_r4 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/generated/sum_r8.c b/libgfortran/generated/sum_r8.c
index 6658de72397..190cabbc22d 100644
--- a/libgfortran/generated/sum_r8.c
+++ b/libgfortran/generated/sum_r8.c
@@ -192,6 +192,9 @@ msum_r8 (gfc_array_r8 * retarray, gfc_array_r8 * array,
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;
diff --git a/libgfortran/m4/iforeach.m4 b/libgfortran/m4/iforeach.m4
index 616caf94621..39af3afef09 100644
--- a/libgfortran/m4/iforeach.m4
+++ b/libgfortran/m4/iforeach.m4
@@ -43,6 +43,9 @@ name`'rtype_qual`_'atype_code (rtype * retarray, atype *array)
if (retarray->dim[0].stride == 0)
retarray->dim[0].stride = 1;
}
+
+ /* TODO: It should be a front end job to correctly set the strides. */
+
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
@@ -151,9 +154,14 @@ void
retarray->dim[0].stride = 1;
}
+ /* TODO: It should be a front end job to correctly set the strides. */
+
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
dstride = retarray->dim[0].stride;
dest = retarray->data;
for (n = 0; n < rank; n++)
diff --git a/libgfortran/m4/ifunction.m4 b/libgfortran/m4/ifunction.m4
index b377677a5eb..82a74ef80b4 100644
--- a/libgfortran/m4/ifunction.m4
+++ b/libgfortran/m4/ifunction.m4
@@ -40,6 +40,9 @@ name`'rtype_qual`_'atype_code (rtype *retarray, atype *array, index_type *pdim)
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+ /* TODO: It should be a front end job to correctly set the strides. */
+
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
@@ -174,9 +177,15 @@ void
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
+
+ /* TODO: It should be a front end job to correctly set the strides. */
+
if (array->dim[0].stride == 0)
array->dim[0].stride = 1;
+ if (mask->dim[0].stride == 0)
+ mask->dim[0].stride = 1;
+
len = array->dim[dim].ubound + 1 - array->dim[dim].lbound;
if (len <= 0)
return;