re PR fortran/81581 (runtime checks for DIM argument of intrinsic SUM missing)

2017-07-31  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/81581
	* m4/ifuntion.m4 (name`'rtype_qual`_'atype_code): Perform check
	for dim.
	(`m'name`'rtype_qual`_'atype_code): Likewise. Change type of rank
	and tim to index_type.
	(`s'name`'rtype_qual`_'atype_code): Perform check for dim.
	* generated/iall_i16.c: Regenerated.
	* generated/iall_i1.c: Regenerated.
	* generated/iall_i2.c: Regenerated.
	* generated/iall_i4.c: Regenerated.
	* generated/iall_i8.c: Regenerated.
	* generated/iany_i16.c: Regenerated.
	* generated/iany_i1.c: Regenerated.
	* generated/iany_i2.c: Regenerated.
	* generated/iany_i4.c: Regenerated.
	* generated/iany_i8.c: Regenerated.
	* generated/iparity_i16.c: Regenerated.
	* generated/iparity_i1.c: Regenerated.
	* generated/iparity_i2.c: Regenerated.
	* generated/iparity_i4.c: Regenerated.
	* generated/iparity_i8.c: Regenerated.
	* generated/maxloc1_16_i16.c: Regenerated.
	* generated/maxloc1_16_i1.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_i16.c: Regenerated.
	* generated/maxloc1_4_i1.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_i16.c: Regenerated.
	* generated/maxloc1_8_i1.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_i16.c: Regenerated.
	* generated/maxval_i1.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_i16.c: Regenerated.
	* generated/minloc1_16_i1.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_i16.c: Regenerated.
	* generated/minloc1_4_i1.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_i16.c: Regenerated.
	* generated/minloc1_8_i1.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_i16.c: Regenerated.
	* generated/minval_i1.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/norm2_r10.c: Regenerated.
	* generated/norm2_r16.c: Regenerated.
	* generated/norm2_r4.c: Regenerated.
	* generated/norm2_r8.c: Regenerated.
	* generated/parity_l16.c: Regenerated.
	* generated/parity_l1.c: Regenerated.
	* generated/parity_l2.c: Regenerated.
	* generated/parity_l4.c: Regenerated.
	* generated/parity_l8.c: Regenerated.
	* generated/product_c10.c: Regenerated.
	* generated/product_c16.c: Regenerated.
	* generated/product_c4.c: Regenerated.
	* generated/product_c8.c: Regenerated.
	* generated/product_i16.c: Regenerated.
	* generated/product_i1.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_i16.c: Regenerated.
	* generated/sum_i1.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.

2017-07-31  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/81581
	* gfortran.dg/dim_sum_1.f90: New test case.
	* gfortran.dg/dim_sum_2.f90: New test case.
	* gfortran.dg/dim_sum_3.f90: New test case.

From-SVN: r250735
This commit is contained in:
Thomas Koenig 2017-07-31 09:34:36 +00:00
parent 57b1c5e9ab
commit cfdf6ff61b
128 changed files with 3170 additions and 350 deletions

View File

@ -1,3 +1,10 @@
2017-07-31 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/81581
* gfortran.dg/dim_sum_1.f90: New test case.
* gfortran.dg/dim_sum_2.f90: New test case.
* gfortran.dg/dim_sum_3.f90: New test case.
2017-07-31 Martin Liska <mliska@suse.cz>
* gcc.dg/builtin-unreachable-6.c: Update scanned patterns.

View File

@ -0,0 +1,37 @@
! { dg-do run }
! { dg-shouldfail "Dim argument incorrect in SUM intrinsic: is 5, should be between 1 and 2" }
program summation
integer, parameter :: n1=5, n2=7
integer, dimension(1:n1,1:n2) :: arr
integer, dimension(1:n1) :: r2
integer, dimension(1:n2) :: r1
integer :: i,j
character(len=80) :: c1, c2
character(len=50) :: fmt = '(10I5)'
do j=1,n2
do i=1,n1
arr(i,j) = i+j*10
end do
end do
r1 = sum(arr,dim=1)
write (unit=c2, fmt=fmt) r1
call print_sum(1,c1)
if (c1 /= c2) call abort
r2 = sum(arr,dim=2)
write (unit=c2, fmt=fmt) r2
call print_sum(2,c1)
if (c1 /= c2) call abort
call print_sum(5,c1)
contains
subroutine print_sum(d, c)
integer, intent(in) :: d
character(len=80), intent(out) :: c
write (unit=c, fmt=fmt) sum(arr,dim=d)
end subroutine
end

View File

@ -0,0 +1,37 @@
! { dg-do run }
! { dg-shouldfail "Dim argument incorrect in SUM intrinsic: is 5, should be between 1 and 2" }
program summation
integer, parameter :: n1=5, n2=7
integer, dimension(1:n1,1:n2) :: arr
integer, dimension(1:n1) :: r2
integer, dimension(1:n2) :: r1
integer :: i,j
character(len=80) :: c1, c2
character(len=50) :: fmt = '(10I5)'
do j=1,n2
do i=1,n1
arr(i,j) = i+j*10
end do
end do
r1 = sum(arr,dim=1,mask=arr>23)
write (unit=c2, fmt=fmt) r1
call print_sum(1,c1)
if (c1 /= c2) call abort
r2 = sum(arr,dim=2,mask=arr>23)
write (unit=c2, fmt=fmt) r2
call print_sum(2,c1)
if (c1 /= c2) call abort
call print_sum(5,c1)
contains
subroutine print_sum(d, c)
integer, intent(in) :: d
character(len=80), intent(out) :: c
write (unit=c, fmt=fmt) sum(arr,dim=d,mask=arr>23)
end subroutine
end

View File

@ -0,0 +1,37 @@
! { dg-do run }
! { dg-shouldfail "Dim argument incorrect in SUM intrinsic: is 5, should be between 1 and 2" }
program summation
integer, parameter :: n1=5, n2=7
integer, dimension(1:n1,1:n2) :: arr
integer, dimension(1:n1) :: r2
integer, dimension(1:n2) :: r1
integer :: i,j
character(len=80) :: c1, c2
character(len=50) :: fmt = '(10I5)'
do j=1,n2
do i=1,n1
arr(i,j) = i+j*10
end do
end do
r1 = sum(arr,dim=1,mask=.true.)
write (unit=c2, fmt=fmt) r1
call print_sum(1,c1)
if (c1 /= c2) call abort
r2 = sum(arr,dim=2,mask=.true.)
write (unit=c2, fmt=fmt) r2
call print_sum(2,c1)
if (c1 /= c2) call abort
call print_sum(5,c1)
contains
subroutine print_sum(d, c)
integer, intent(in) :: d
character(len=80), intent(out) :: c
write (unit=c, fmt=fmt) sum(arr,dim=d,mask=.true.)
end subroutine
end

View File

@ -1,3 +1,134 @@
2017-07-31 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/81581
* m4/ifuntion.m4 (name`'rtype_qual`_'atype_code): Perform check
for dim.
(`m'name`'rtype_qual`_'atype_code): Likewise. Change type of rank
and tim to index_type.
(`s'name`'rtype_qual`_'atype_code): Perform check for dim.
* generated/iall_i16.c: Regenerated.
* generated/iall_i1.c: Regenerated.
* generated/iall_i2.c: Regenerated.
* generated/iall_i4.c: Regenerated.
* generated/iall_i8.c: Regenerated.
* generated/iany_i16.c: Regenerated.
* generated/iany_i1.c: Regenerated.
* generated/iany_i2.c: Regenerated.
* generated/iany_i4.c: Regenerated.
* generated/iany_i8.c: Regenerated.
* generated/iparity_i16.c: Regenerated.
* generated/iparity_i1.c: Regenerated.
* generated/iparity_i2.c: Regenerated.
* generated/iparity_i4.c: Regenerated.
* generated/iparity_i8.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/maxloc1_16_i1.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_i16.c: Regenerated.
* generated/maxloc1_4_i1.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_i16.c: Regenerated.
* generated/maxloc1_8_i1.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_i16.c: Regenerated.
* generated/maxval_i1.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_i16.c: Regenerated.
* generated/minloc1_16_i1.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_i16.c: Regenerated.
* generated/minloc1_4_i1.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_i16.c: Regenerated.
* generated/minloc1_8_i1.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_i16.c: Regenerated.
* generated/minval_i1.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/norm2_r10.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/product_i1.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_i16.c: Regenerated.
* generated/sum_i1.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.
2017-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/80365

View File

@ -52,8 +52,15 @@ iall_i1 (gfc_array_i1 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miall_i1 (gfc_array_i1 * const restrict retarray,
GFC_INTEGER_1 * restrict dest;
const GFC_INTEGER_1 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miall_i1 (gfc_array_i1 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siall_i1 (gfc_array_i1 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ iall_i16 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miall_i16 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miall_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siall_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ iall_i2 (gfc_array_i2 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miall_i2 (gfc_array_i2 * const restrict retarray,
GFC_INTEGER_2 * restrict dest;
const GFC_INTEGER_2 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miall_i2 (gfc_array_i2 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siall_i2 (gfc_array_i2 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ iall_i4 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miall_i4 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miall_i4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siall_i4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ iall_i8 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miall_i8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siall_i8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IALL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ iany_i1 (gfc_array_i1 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miany_i1 (gfc_array_i1 * const restrict retarray,
GFC_INTEGER_1 * restrict dest;
const GFC_INTEGER_1 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miany_i1 (gfc_array_i1 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siany_i1 (gfc_array_i1 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ iany_i16 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miany_i16 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miany_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siany_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ iany_i2 (gfc_array_i2 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miany_i2 (gfc_array_i2 * const restrict retarray,
GFC_INTEGER_2 * restrict dest;
const GFC_INTEGER_2 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miany_i2 (gfc_array_i2 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siany_i2 (gfc_array_i2 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ iany_i4 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miany_i4 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miany_i4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siany_i4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ iany_i8 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miany_i8 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miany_i8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siany_i8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IANY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ iparity_i1 (gfc_array_i1 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miparity_i1 (gfc_array_i1 * const restrict retarray,
GFC_INTEGER_1 * restrict dest;
const GFC_INTEGER_1 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miparity_i1 (gfc_array_i1 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siparity_i1 (gfc_array_i1 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ iparity_i16 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miparity_i16 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miparity_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siparity_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ iparity_i2 (gfc_array_i2 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miparity_i2 (gfc_array_i2 * const restrict retarray,
GFC_INTEGER_2 * restrict dest;
const GFC_INTEGER_2 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miparity_i2 (gfc_array_i2 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siparity_i2 (gfc_array_i2 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ iparity_i4 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miparity_i4 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miparity_i4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siparity_i4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ iparity_i8 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -203,8 +210,8 @@ miparity_i8 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -214,6 +221,14 @@ miparity_i8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -391,6 +406,13 @@ siparity_i8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in IPARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_1 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_16_i1 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_16_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_2 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_16_i2 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_16_i4 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_16_i8 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_10 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_16_r10 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_16_r16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_16_r4 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_16_r8 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_1 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_4_i1 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_4_i16 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_2 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_4_i2 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_4_i4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_4_i8 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_10 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_4_r10 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_4_r16 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_4_r4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_4_r8 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_1 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_8_i1 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_8_i16 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_2 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_8_i2 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_8_i4 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_8_i8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_10 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_8_r10 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_8_r16 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_8_r4 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ smaxloc1_8_r8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxval_i1 (gfc_array_i1 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
GFC_INTEGER_1 * restrict dest;
const GFC_INTEGER_1 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ smaxval_i1 (gfc_array_i1 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxval_i16 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ smaxval_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxval_i2 (gfc_array_i2 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
GFC_INTEGER_2 * restrict dest;
const GFC_INTEGER_2 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ smaxval_i2 (gfc_array_i2 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxval_i4 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ smaxval_i4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxval_i8 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ smaxval_i8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxval_r10 (gfc_array_r10 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
GFC_REAL_10 * restrict dest;
const GFC_REAL_10 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ smaxval_r10 (gfc_array_r10 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxval_r16 (gfc_array_r16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
GFC_REAL_16 * restrict dest;
const GFC_REAL_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ smaxval_r16 (gfc_array_r16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxval_r4 (gfc_array_r4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
GFC_REAL_4 * restrict dest;
const GFC_REAL_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ smaxval_r4 (gfc_array_r4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ maxval_r8 (gfc_array_r8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
GFC_REAL_8 * restrict dest;
const GFC_REAL_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ smaxval_r8 (gfc_array_r8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MAXVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_16_i1 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_1 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_16_i1 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_16_i16 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_16_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_16_i2 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_2 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_16_i2 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_16_i4 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_16_i4 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_16_i8 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_16_i8 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_16_r10 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_10 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_16_r10 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_16_r16 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_16_r16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_16_r4 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_16_r4 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_16_r8 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_REAL_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_16_r8 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_4_i1 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_1 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_4_i1 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_4_i16 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_4_i16 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_4_i2 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_2 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_4_i2 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_4_i4 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_4_i4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_4_i8 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_4_i8 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_4_r10 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_10 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_4_r10 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_4_r16 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_4_r16 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_4_r4 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_4_r4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_4_r8 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_REAL_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_4_r8 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_8_i1 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_1 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_8_i1 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_8_i16 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_8_i16 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_8_i2 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_2 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_8_i2 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_8_i4 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_8_i4 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_8_i8 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_8_i8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_8_r10 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_10 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_8_r16 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_8_r16 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_8_r4 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_8_r4 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minloc1_8_r8 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -224,8 +231,8 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_REAL_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -235,6 +242,14 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -445,6 +460,13 @@ sminloc1_8_r8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINLOC intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minval_i1 (gfc_array_i1 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mminval_i1 (gfc_array_i1 * const restrict retarray,
GFC_INTEGER_1 * restrict dest;
const GFC_INTEGER_1 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mminval_i1 (gfc_array_i1 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ sminval_i1 (gfc_array_i1 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minval_i16 (gfc_array_i16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
GFC_INTEGER_16 * restrict dest;
const GFC_INTEGER_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mminval_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ sminval_i16 (gfc_array_i16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minval_i2 (gfc_array_i2 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mminval_i2 (gfc_array_i2 * const restrict retarray,
GFC_INTEGER_2 * restrict dest;
const GFC_INTEGER_2 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mminval_i2 (gfc_array_i2 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ sminval_i2 (gfc_array_i2 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minval_i4 (gfc_array_i4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mminval_i4 (gfc_array_i4 * const restrict retarray,
GFC_INTEGER_4 * restrict dest;
const GFC_INTEGER_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mminval_i4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ sminval_i4 (gfc_array_i4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minval_i8 (gfc_array_i8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mminval_i8 (gfc_array_i8 * const restrict retarray,
GFC_INTEGER_8 * restrict dest;
const GFC_INTEGER_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mminval_i8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ sminval_i8 (gfc_array_i8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minval_r10 (gfc_array_r10 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mminval_r10 (gfc_array_r10 * const restrict retarray,
GFC_REAL_10 * restrict dest;
const GFC_REAL_10 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mminval_r10 (gfc_array_r10 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ sminval_r10 (gfc_array_r10 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minval_r16 (gfc_array_r16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mminval_r16 (gfc_array_r16 * const restrict retarray,
GFC_REAL_16 * restrict dest;
const GFC_REAL_16 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mminval_r16 (gfc_array_r16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ sminval_r16 (gfc_array_r16 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minval_r4 (gfc_array_r4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mminval_r4 (gfc_array_r4 * const restrict retarray,
GFC_REAL_4 * restrict dest;
const GFC_REAL_4 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mminval_r4 (gfc_array_r4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ sminval_r4 (gfc_array_r4 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -52,8 +52,15 @@ minval_r8 (gfc_array_r8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)
@ -217,8 +224,8 @@ mminval_r8 (gfc_array_r8 * const restrict retarray,
GFC_REAL_8 * restrict dest;
const GFC_REAL_8 * restrict base;
const GFC_LOGICAL_1 * restrict mbase;
int rank;
int dim;
index_type rank;
index_type dim;
index_type n;
index_type len;
index_type delta;
@ -228,6 +235,14 @@ mminval_r8 (gfc_array_r8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len <= 0)
return;
@ -433,6 +448,13 @@ sminval_r8 (gfc_array_r8 * const restrict retarray,
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in MINVAL intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
for (n = 0; n < dim; n++)
{
extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);

View File

@ -55,8 +55,15 @@ norm2_r10 (gfc_array_r10 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in NORM intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)

View File

@ -59,8 +59,15 @@ norm2_r16 (gfc_array_r16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in NORM intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)

View File

@ -55,8 +55,15 @@ norm2_r4 (gfc_array_r4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in NORM intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)

View File

@ -55,8 +55,15 @@ norm2_r8 (gfc_array_r8 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in NORM intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)

View File

@ -52,8 +52,15 @@ parity_l1 (gfc_array_l1 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in PARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)

View File

@ -52,8 +52,15 @@ parity_l16 (gfc_array_l16 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in PARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)

View File

@ -52,8 +52,15 @@ parity_l2 (gfc_array_l2 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in PARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)

View File

@ -52,8 +52,15 @@ parity_l4 (gfc_array_l4 * const restrict retarray,
int continue_loop;
/* Make dim zero based to avoid confusion. */
dim = (*pdim) - 1;
rank = GFC_DESCRIPTOR_RANK (array) - 1;
dim = (*pdim) - 1;
if (unlikely (dim < 0 || dim > rank))
{
runtime_error ("Dim argument incorrect in PARITY intrinsic: "
"is %ld, should be between 1 and %ld",
(long int) dim + 1, (long int) rank + 1);
}
len = GFC_DESCRIPTOR_EXTENT(array,dim);
if (len < 0)

Some files were not shown because too many files have changed in this diff Show More