diff options
author | tkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-19 15:07:21 +0000 |
---|---|---|
committer | tkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-19 15:07:21 +0000 |
commit | 5d04d45074296dada2e374cd955a2901b6141e71 (patch) | |
tree | 28774f9933d09cfe5f0816f6b9a4a36da7361147 /libgfortran | |
parent | a5d536df523c382cc266ab846912060a2a888eca (diff) | |
download | gcc-5d04d45074296dada2e374cd955a2901b6141e71.tar.gz |
2009-07-19 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/34670
PR libfortran/36874
* Makefile.am: Add bounds.c
* libgfortran.h (bounds_equal_extents): Add prototype.
(bounds_iforeach_return): Likewise.
(bounds_ifunction_return): Likewise.
(bounds_reduced_extents): Likewise.
* runtime/bounds.c: New file.
(bounds_iforeach_return): New function; correct typo in
error message.
(bounds_ifunction_return): New function.
(bounds_equal_extents): New function.
(bounds_reduced_extents): Likewise.
* intrinsics/cshift0.c (cshift0): Use new functions
for bounds checking.
* intrinsics/eoshift0.c (eoshift0): Likewise.
* intrinsics/eoshift2.c (eoshift2): Likewise.
* m4/iforeach.m4: Likewise.
* m4/eoshift1.m4: Likewise.
* m4/eoshift3.m4: Likewise.
* m4/cshift1.m4: Likewise.
* m4/ifunction.m4: Likewise.
* Makefile.in: Regenerated.
* generated/cshift1_16.c: Regenerated.
* generated/cshift1_4.c: Regenerated.
* generated/cshift1_8.c: Regenerated.
* generated/eoshift1_16.c: Regenerated.
* generated/eoshift1_4.c: Regenerated.
* generated/eoshift1_8.c: Regenerated.
* generated/eoshift3_16.c: Regenerated.
* generated/eoshift3_4.c: Regenerated.
* generated/eoshift3_8.c: Regenerated.
* generated/maxloc0_16_i1.c: Regenerated.
* generated/maxloc0_16_i16.c: Regenerated.
* generated/maxloc0_16_i2.c: Regenerated.
* generated/maxloc0_16_i4.c: Regenerated.
* generated/maxloc0_16_i8.c: Regenerated.
* generated/maxloc0_16_r10.c: Regenerated.
* generated/maxloc0_16_r16.c: Regenerated.
* generated/maxloc0_16_r4.c: Regenerated.
* generated/maxloc0_16_r8.c: Regenerated.
* generated/maxloc0_4_i1.c: Regenerated.
* generated/maxloc0_4_i16.c: Regenerated.
* generated/maxloc0_4_i2.c: Regenerated.
* generated/maxloc0_4_i4.c: Regenerated.
* generated/maxloc0_4_i8.c: Regenerated.
* generated/maxloc0_4_r10.c: Regenerated.
* generated/maxloc0_4_r16.c: Regenerated.
* generated/maxloc0_4_r4.c: Regenerated.
* generated/maxloc0_4_r8.c: Regenerated.
* generated/maxloc0_8_i1.c: Regenerated.
* generated/maxloc0_8_i16.c: Regenerated.
* generated/maxloc0_8_i2.c: Regenerated.
* generated/maxloc0_8_i4.c: Regenerated.
* generated/maxloc0_8_i8.c: Regenerated.
* generated/maxloc0_8_r10.c: Regenerated.
* generated/maxloc0_8_r16.c: Regenerated.
* generated/maxloc0_8_r4.c: Regenerated.
* generated/maxloc0_8_r8.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/minloc0_16_i1.c: Regenerated.
* generated/minloc0_16_i16.c: Regenerated.
* generated/minloc0_16_i2.c: Regenerated.
* generated/minloc0_16_i4.c: Regenerated.
* generated/minloc0_16_i8.c: Regenerated.
* generated/minloc0_16_r10.c: Regenerated.
* generated/minloc0_16_r16.c: Regenerated.
* generated/minloc0_16_r4.c: Regenerated.
* generated/minloc0_16_r8.c: Regenerated.
* generated/minloc0_4_i1.c: Regenerated.
* generated/minloc0_4_i16.c: Regenerated.
* generated/minloc0_4_i2.c: Regenerated.
* generated/minloc0_4_i4.c: Regenerated.
* generated/minloc0_4_i8.c: Regenerated.
* generated/minloc0_4_r10.c: Regenerated.
* generated/minloc0_4_r16.c: Regenerated.
* generated/minloc0_4_r4.c: Regenerated.
* generated/minloc0_4_r8.c: Regenerated.
* generated/minloc0_8_i1.c: Regenerated.
* generated/minloc0_8_i16.c: Regenerated.
* generated/minloc0_8_i2.c: Regenerated.
* generated/minloc0_8_i4.c: Regenerated.
* generated/minloc0_8_i8.c: Regenerated.
* generated/minloc0_8_r10.c: Regenerated.
* generated/minloc0_8_r16.c: Regenerated.
* generated/minloc0_8_r4.c: Regenerated.
* generated/minloc0_8_r8.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/sum_r8.c: Regenerated.
2009-07-19 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/34670
PR libfortran/36874
* gfortran.dg/cshift_bounds_1.f90: New test.
* gfortran.dg/cshift_bounds_2.f90: New test.
* gfortran.dg/cshift_bounds_3.f90: New test.
* gfortran.dg/cshift_bounds_4.f90: New test.
* gfortran.dg/eoshift_bounds_1.f90: New test.
* gfortran.dg/maxloc_bounds_4.f90: Correct typo in error message.
* gfortran.dg/maxloc_bounds_5.f90: Correct typo in error message.
* gfortran.dg/maxloc_bounds_7.f90: Correct typo in error message.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149792 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
174 files changed, 1792 insertions, 7023 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 23746839c5d..8231ed1588c 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,190 @@ +2009-07-19 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR libfortran/34670 + PR libfortran/36874 + * Makefile.am: Add bounds.c + * libgfortran.h (bounds_equal_extents): Add prototype. + (bounds_iforeach_return): Likewise. + (bounds_ifunction_return): Likewise. + (bounds_reduced_extents): Likewise. + * runtime/bounds.c: New file. + (bounds_iforeach_return): New function; correct typo in + error message. + (bounds_ifunction_return): New function. + (bounds_equal_extents): New function. + (bounds_reduced_extents): Likewise. + * intrinsics/cshift0.c (cshift0): Use new functions + for bounds checking. + * intrinsics/eoshift0.c (eoshift0): Likewise. + * intrinsics/eoshift2.c (eoshift2): Likewise. + * m4/iforeach.m4: Likewise. + * m4/eoshift1.m4: Likewise. + * m4/eoshift3.m4: Likewise. + * m4/cshift1.m4: Likewise. + * m4/ifunction.m4: Likewise. + * Makefile.in: Regenerated. + * generated/cshift1_16.c: Regenerated. + * generated/cshift1_4.c: Regenerated. + * generated/cshift1_8.c: Regenerated. + * generated/eoshift1_16.c: Regenerated. + * generated/eoshift1_4.c: Regenerated. + * generated/eoshift1_8.c: Regenerated. + * generated/eoshift3_16.c: Regenerated. + * generated/eoshift3_4.c: Regenerated. + * generated/eoshift3_8.c: Regenerated. + * generated/maxloc0_16_i1.c: Regenerated. + * generated/maxloc0_16_i16.c: Regenerated. + * generated/maxloc0_16_i2.c: Regenerated. + * generated/maxloc0_16_i4.c: Regenerated. + * generated/maxloc0_16_i8.c: Regenerated. + * generated/maxloc0_16_r10.c: Regenerated. + * generated/maxloc0_16_r16.c: Regenerated. + * generated/maxloc0_16_r4.c: Regenerated. + * generated/maxloc0_16_r8.c: Regenerated. + * generated/maxloc0_4_i1.c: Regenerated. + * generated/maxloc0_4_i16.c: Regenerated. + * generated/maxloc0_4_i2.c: Regenerated. + * generated/maxloc0_4_i4.c: Regenerated. + * generated/maxloc0_4_i8.c: Regenerated. + * generated/maxloc0_4_r10.c: Regenerated. + * generated/maxloc0_4_r16.c: Regenerated. + * generated/maxloc0_4_r4.c: Regenerated. + * generated/maxloc0_4_r8.c: Regenerated. + * generated/maxloc0_8_i1.c: Regenerated. + * generated/maxloc0_8_i16.c: Regenerated. + * generated/maxloc0_8_i2.c: Regenerated. + * generated/maxloc0_8_i4.c: Regenerated. + * generated/maxloc0_8_i8.c: Regenerated. + * generated/maxloc0_8_r10.c: Regenerated. + * generated/maxloc0_8_r16.c: Regenerated. + * generated/maxloc0_8_r4.c: Regenerated. + * generated/maxloc0_8_r8.c: Regenerated. + * generated/maxloc1_16_i1.c: Regenerated. + * generated/maxloc1_16_i16.c: Regenerated. + * generated/maxloc1_16_i2.c: Regenerated. + * generated/maxloc1_16_i4.c: Regenerated. + * generated/maxloc1_16_i8.c: Regenerated. + * generated/maxloc1_16_r10.c: Regenerated. + * generated/maxloc1_16_r16.c: Regenerated. + * generated/maxloc1_16_r4.c: Regenerated. + * generated/maxloc1_16_r8.c: Regenerated. + * generated/maxloc1_4_i1.c: Regenerated. + * generated/maxloc1_4_i16.c: Regenerated. + * generated/maxloc1_4_i2.c: Regenerated. + * generated/maxloc1_4_i4.c: Regenerated. + * generated/maxloc1_4_i8.c: Regenerated. + * generated/maxloc1_4_r10.c: Regenerated. + * generated/maxloc1_4_r16.c: Regenerated. + * generated/maxloc1_4_r4.c: Regenerated. + * generated/maxloc1_4_r8.c: Regenerated. + * generated/maxloc1_8_i1.c: Regenerated. + * generated/maxloc1_8_i16.c: Regenerated. + * generated/maxloc1_8_i2.c: Regenerated. + * generated/maxloc1_8_i4.c: Regenerated. + * generated/maxloc1_8_i8.c: Regenerated. + * generated/maxloc1_8_r10.c: Regenerated. + * generated/maxloc1_8_r16.c: Regenerated. + * generated/maxloc1_8_r4.c: Regenerated. + * generated/maxloc1_8_r8.c: Regenerated. + * generated/maxval_i1.c: Regenerated. + * generated/maxval_i16.c: Regenerated. + * generated/maxval_i2.c: Regenerated. + * generated/maxval_i4.c: Regenerated. + * generated/maxval_i8.c: Regenerated. + * generated/maxval_r10.c: Regenerated. + * generated/maxval_r16.c: Regenerated. + * generated/maxval_r4.c: Regenerated. + * generated/maxval_r8.c: Regenerated. + * generated/minloc0_16_i1.c: Regenerated. + * generated/minloc0_16_i16.c: Regenerated. + * generated/minloc0_16_i2.c: Regenerated. + * generated/minloc0_16_i4.c: Regenerated. + * generated/minloc0_16_i8.c: Regenerated. + * generated/minloc0_16_r10.c: Regenerated. + * generated/minloc0_16_r16.c: Regenerated. + * generated/minloc0_16_r4.c: Regenerated. + * generated/minloc0_16_r8.c: Regenerated. + * generated/minloc0_4_i1.c: Regenerated. + * generated/minloc0_4_i16.c: Regenerated. + * generated/minloc0_4_i2.c: Regenerated. + * generated/minloc0_4_i4.c: Regenerated. + * generated/minloc0_4_i8.c: Regenerated. + * generated/minloc0_4_r10.c: Regenerated. + * generated/minloc0_4_r16.c: Regenerated. + * generated/minloc0_4_r4.c: Regenerated. + * generated/minloc0_4_r8.c: Regenerated. + * generated/minloc0_8_i1.c: Regenerated. + * generated/minloc0_8_i16.c: Regenerated. + * generated/minloc0_8_i2.c: Regenerated. + * generated/minloc0_8_i4.c: Regenerated. + * generated/minloc0_8_i8.c: Regenerated. + * generated/minloc0_8_r10.c: Regenerated. + * generated/minloc0_8_r16.c: Regenerated. + * generated/minloc0_8_r4.c: Regenerated. + * generated/minloc0_8_r8.c: Regenerated. + * generated/minloc1_16_i1.c: Regenerated. + * generated/minloc1_16_i16.c: Regenerated. + * generated/minloc1_16_i2.c: Regenerated. + * generated/minloc1_16_i4.c: Regenerated. + * generated/minloc1_16_i8.c: Regenerated. + * generated/minloc1_16_r10.c: Regenerated. + * generated/minloc1_16_r16.c: Regenerated. + * generated/minloc1_16_r4.c: Regenerated. + * generated/minloc1_16_r8.c: Regenerated. + * generated/minloc1_4_i1.c: Regenerated. + * generated/minloc1_4_i16.c: Regenerated. + * generated/minloc1_4_i2.c: Regenerated. + * generated/minloc1_4_i4.c: Regenerated. + * generated/minloc1_4_i8.c: Regenerated. + * generated/minloc1_4_r10.c: Regenerated. + * generated/minloc1_4_r16.c: Regenerated. + * generated/minloc1_4_r4.c: Regenerated. + * generated/minloc1_4_r8.c: Regenerated. + * generated/minloc1_8_i1.c: Regenerated. + * generated/minloc1_8_i16.c: Regenerated. + * generated/minloc1_8_i2.c: Regenerated. + * generated/minloc1_8_i4.c: Regenerated. + * generated/minloc1_8_i8.c: Regenerated. + * generated/minloc1_8_r10.c: Regenerated. + * generated/minloc1_8_r16.c: Regenerated. + * generated/minloc1_8_r4.c: Regenerated. + * generated/minloc1_8_r8.c: Regenerated. + * generated/minval_i1.c: Regenerated. + * generated/minval_i16.c: Regenerated. + * generated/minval_i2.c: Regenerated. + * generated/minval_i4.c: Regenerated. + * generated/minval_i8.c: Regenerated. + * generated/minval_r10.c: Regenerated. + * generated/minval_r16.c: Regenerated. + * generated/minval_r4.c: Regenerated. + * generated/minval_r8.c: Regenerated. + * generated/product_c10.c: Regenerated. + * generated/product_c16.c: Regenerated. + * generated/product_c4.c: Regenerated. + * generated/product_c8.c: Regenerated. + * generated/product_i1.c: Regenerated. + * generated/product_i16.c: Regenerated. + * generated/product_i2.c: Regenerated. + * generated/product_i4.c: Regenerated. + * generated/product_i8.c: Regenerated. + * generated/product_r10.c: Regenerated. + * generated/product_r16.c: Regenerated. + * generated/product_r4.c: Regenerated. + * generated/product_r8.c: Regenerated. + * generated/sum_c10.c: Regenerated. + * generated/sum_c16.c: Regenerated. + * generated/sum_c4.c: Regenerated. + * generated/sum_c8.c: Regenerated. + * generated/sum_i1.c: Regenerated. + * generated/sum_i16.c: Regenerated. + * generated/sum_i2.c: Regenerated. + * generated/sum_i4.c: Regenerated. + * generated/sum_i8.c: Regenerated. + * generated/sum_r10.c: Regenerated. + * generated/sum_r16.c: Regenerated. + * generated/sum_r4.c: Regenerated. + * generated/sum_r8.c: Regenerated. + 2009-07-17 Janne Blomqvist <jb@gcc.gnu.org> Jerry DeLisle <jvdelisle@gcc.gnu.org> diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am index f5f92dfb432..4a974ba0066 100644 --- a/libgfortran/Makefile.am +++ b/libgfortran/Makefile.am @@ -122,6 +122,7 @@ runtime/in_unpack_generic.c gfor_src= \ runtime/backtrace.c \ +runtime/bounds.c \ runtime/compile_options.c \ runtime/convert_char.c \ runtime/environ.c \ diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in index ce2b5a21cb1..7741c324aaf 100644 --- a/libgfortran/Makefile.in +++ b/libgfortran/Makefile.in @@ -78,7 +78,7 @@ myexeclibLTLIBRARIES_INSTALL = $(INSTALL) toolexeclibLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(myexeclib_LTLIBRARIES) $(toolexeclib_LTLIBRARIES) libgfortran_la_LIBADD = -am__libgfortran_la_SOURCES_DIST = runtime/backtrace.c \ +am__libgfortran_la_SOURCES_DIST = runtime/backtrace.c runtime/bounds.c \ runtime/compile_options.c runtime/convert_char.c \ runtime/environ.c runtime/error.c runtime/fpu.c runtime/main.c \ runtime/memory.c runtime/pause.c runtime/stop.c \ @@ -580,9 +580,9 @@ am__libgfortran_la_SOURCES_DIST = runtime/backtrace.c \ $(srcdir)/generated/misc_specifics.F90 intrinsics/dprod_r8.f90 \ intrinsics/f2c_specifics.F90 libgfortran_c.c $(filter-out \ %.c,$(prereq_SRC)) -am__objects_1 = backtrace.lo compile_options.lo convert_char.lo \ - environ.lo error.lo fpu.lo main.lo memory.lo pause.lo stop.lo \ - string.lo select.lo +am__objects_1 = backtrace.lo bounds.lo compile_options.lo \ + convert_char.lo environ.lo error.lo fpu.lo main.lo memory.lo \ + pause.lo stop.lo string.lo select.lo am__objects_2 = all_l1.lo all_l2.lo all_l4.lo all_l8.lo all_l16.lo am__objects_3 = any_l1.lo any_l2.lo any_l4.lo any_l8.lo any_l16.lo am__objects_4 = count_1_l.lo count_2_l.lo count_4_l.lo count_8_l.lo \ @@ -1050,6 +1050,7 @@ runtime/in_unpack_generic.c gfor_src = \ runtime/backtrace.c \ +runtime/bounds.c \ runtime/compile_options.c \ runtime/convert_char.c \ runtime/environ.c \ @@ -1806,6 +1807,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/associated.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backtrace.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bit_intrinsics.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bounds.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c99_functions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chdir.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmod.Plo@am__quote@ @@ -2678,6 +2680,13 @@ backtrace.lo: runtime/backtrace.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o backtrace.lo `test -f 'runtime/backtrace.c' || echo '$(srcdir)/'`runtime/backtrace.c +bounds.lo: runtime/bounds.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT bounds.lo -MD -MP -MF "$(DEPDIR)/bounds.Tpo" -c -o bounds.lo `test -f 'runtime/bounds.c' || echo '$(srcdir)/'`runtime/bounds.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/bounds.Tpo" "$(DEPDIR)/bounds.Plo"; else rm -f "$(DEPDIR)/bounds.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='runtime/bounds.c' object='bounds.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bounds.lo `test -f 'runtime/bounds.c' || echo '$(srcdir)/'`runtime/bounds.c + compile_options.lo: runtime/compile_options.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT compile_options.lo -MD -MP -MF "$(DEPDIR)/compile_options.Tpo" -c -o compile_options.lo `test -f 'runtime/compile_options.c' || echo '$(srcdir)/'`runtime/compile_options.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/compile_options.Tpo" "$(DEPDIR)/compile_options.Plo"; else rm -f "$(DEPDIR)/compile_options.Tpo"; exit 1; fi diff --git a/libgfortran/generated/cshift1_16.c b/libgfortran/generated/cshift1_16.c index df97dfa6b76..b2cb7f17ce4 100644 --- a/libgfortran/generated/cshift1_16.c +++ b/libgfortran/generated/cshift1_16.c @@ -98,6 +98,17 @@ cshift1 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } } + else if (unlikely (compile_options.bounds_check)) + { + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "CSHIFT"); + } + + if (unlikely (compile_options.bounds_check)) + { + bounds_reduced_extents ((array_t *) h, (array_t *) array, which, + "SHIFT argument", "CSHIFT"); + } if (arraysize == 0) return; diff --git a/libgfortran/generated/cshift1_4.c b/libgfortran/generated/cshift1_4.c index f048e8e401f..30f3d99dc35 100644 --- a/libgfortran/generated/cshift1_4.c +++ b/libgfortran/generated/cshift1_4.c @@ -98,6 +98,17 @@ cshift1 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } } + else if (unlikely (compile_options.bounds_check)) + { + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "CSHIFT"); + } + + if (unlikely (compile_options.bounds_check)) + { + bounds_reduced_extents ((array_t *) h, (array_t *) array, which, + "SHIFT argument", "CSHIFT"); + } if (arraysize == 0) return; diff --git a/libgfortran/generated/cshift1_8.c b/libgfortran/generated/cshift1_8.c index 9667728f392..c3bf473e49c 100644 --- a/libgfortran/generated/cshift1_8.c +++ b/libgfortran/generated/cshift1_8.c @@ -98,6 +98,17 @@ cshift1 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } } + else if (unlikely (compile_options.bounds_check)) + { + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "CSHIFT"); + } + + if (unlikely (compile_options.bounds_check)) + { + bounds_reduced_extents ((array_t *) h, (array_t *) array, which, + "SHIFT argument", "CSHIFT"); + } if (arraysize == 0) return; diff --git a/libgfortran/generated/eoshift1_16.c b/libgfortran/generated/eoshift1_16.c index 02365cc2375..a14bd292715 100644 --- a/libgfortran/generated/eoshift1_16.c +++ b/libgfortran/generated/eoshift1_16.c @@ -62,6 +62,7 @@ eoshift1 (gfc_array_char * const restrict ret, index_type len; index_type n; index_type size; + index_type arraysize; int which; GFC_INTEGER_16 sh; GFC_INTEGER_16 delta; @@ -82,11 +83,12 @@ eoshift1 (gfc_array_char * const restrict ret, extent[0] = 1; count[0] = 0; + arraysize = size0 ((array_t *) array); if (ret->data == NULL) { int i; - ret->data = internal_malloc_size (size * size0 ((array_t *)array)); + ret->data = internal_malloc_size (size * arraysize); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) @@ -104,13 +106,27 @@ eoshift1 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } + if (arraysize > 0) + ret->data = internal_malloc_size (size * arraysize); + else + ret->data = internal_malloc_size (1); + } - else + else if (unlikely (compile_options.bounds_check)) { - if (size0 ((array_t *) ret) == 0) - return; + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "EOSHIFT"); } + if (unlikely (compile_options.bounds_check)) + { + bounds_reduced_extents ((array_t *) h, (array_t *) array, which, + "SHIFT argument", "EOSHIFT"); + } + + if (arraysize == 0) + return; + n = 0; for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++) { diff --git a/libgfortran/generated/eoshift1_4.c b/libgfortran/generated/eoshift1_4.c index e703db47786..06bc309c4a8 100644 --- a/libgfortran/generated/eoshift1_4.c +++ b/libgfortran/generated/eoshift1_4.c @@ -62,6 +62,7 @@ eoshift1 (gfc_array_char * const restrict ret, index_type len; index_type n; index_type size; + index_type arraysize; int which; GFC_INTEGER_4 sh; GFC_INTEGER_4 delta; @@ -82,11 +83,12 @@ eoshift1 (gfc_array_char * const restrict ret, extent[0] = 1; count[0] = 0; + arraysize = size0 ((array_t *) array); if (ret->data == NULL) { int i; - ret->data = internal_malloc_size (size * size0 ((array_t *)array)); + ret->data = internal_malloc_size (size * arraysize); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) @@ -104,13 +106,27 @@ eoshift1 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } + if (arraysize > 0) + ret->data = internal_malloc_size (size * arraysize); + else + ret->data = internal_malloc_size (1); + } - else + else if (unlikely (compile_options.bounds_check)) { - if (size0 ((array_t *) ret) == 0) - return; + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "EOSHIFT"); } + if (unlikely (compile_options.bounds_check)) + { + bounds_reduced_extents ((array_t *) h, (array_t *) array, which, + "SHIFT argument", "EOSHIFT"); + } + + if (arraysize == 0) + return; + n = 0; for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++) { diff --git a/libgfortran/generated/eoshift1_8.c b/libgfortran/generated/eoshift1_8.c index f8922b344a5..3e9162d0f08 100644 --- a/libgfortran/generated/eoshift1_8.c +++ b/libgfortran/generated/eoshift1_8.c @@ -62,6 +62,7 @@ eoshift1 (gfc_array_char * const restrict ret, index_type len; index_type n; index_type size; + index_type arraysize; int which; GFC_INTEGER_8 sh; GFC_INTEGER_8 delta; @@ -82,11 +83,12 @@ eoshift1 (gfc_array_char * const restrict ret, extent[0] = 1; count[0] = 0; + arraysize = size0 ((array_t *) array); if (ret->data == NULL) { int i; - ret->data = internal_malloc_size (size * size0 ((array_t *)array)); + ret->data = internal_malloc_size (size * arraysize); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) @@ -104,13 +106,27 @@ eoshift1 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } + if (arraysize > 0) + ret->data = internal_malloc_size (size * arraysize); + else + ret->data = internal_malloc_size (1); + } - else + else if (unlikely (compile_options.bounds_check)) { - if (size0 ((array_t *) ret) == 0) - return; + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "EOSHIFT"); } + if (unlikely (compile_options.bounds_check)) + { + bounds_reduced_extents ((array_t *) h, (array_t *) array, which, + "SHIFT argument", "EOSHIFT"); + } + + if (arraysize == 0) + return; + n = 0; for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++) { diff --git a/libgfortran/generated/eoshift3_16.c b/libgfortran/generated/eoshift3_16.c index c3efae9acbf..ec21d1ec14d 100644 --- a/libgfortran/generated/eoshift3_16.c +++ b/libgfortran/generated/eoshift3_16.c @@ -66,6 +66,7 @@ eoshift3 (gfc_array_char * const restrict ret, index_type len; index_type n; index_type size; + index_type arraysize; int which; GFC_INTEGER_16 sh; GFC_INTEGER_16 delta; @@ -76,6 +77,7 @@ eoshift3 (gfc_array_char * const restrict ret, soffset = 0; roffset = 0; + arraysize = size0 ((array_t *) array); size = GFC_DESCRIPTOR_SIZE(array); if (pwhich) @@ -87,7 +89,7 @@ eoshift3 (gfc_array_char * const restrict ret, { int i; - ret->data = internal_malloc_size (size * size0 ((array_t *)array)); + ret->data = internal_malloc_size (size * arraysize); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) @@ -105,13 +107,26 @@ eoshift3 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } + if (arraysize > 0) + ret->data = internal_malloc_size (size * arraysize); + else + ret->data = internal_malloc_size (1); + } - else + else if (unlikely (compile_options.bounds_check)) + { + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "EOSHIFT"); + } + + if (unlikely (compile_options.bounds_check)) { - if (size0 ((array_t *) ret) == 0) - return; + bounds_reduced_extents ((array_t *) h, (array_t *) array, which, + "SHIFT argument", "EOSHIFT"); } + if (arraysize == 0) + return; extent[0] = 1; count[0] = 0; diff --git a/libgfortran/generated/eoshift3_4.c b/libgfortran/generated/eoshift3_4.c index 5038c0916bd..ce4cede1f1d 100644 --- a/libgfortran/generated/eoshift3_4.c +++ b/libgfortran/generated/eoshift3_4.c @@ -66,6 +66,7 @@ eoshift3 (gfc_array_char * const restrict ret, index_type len; index_type n; index_type size; + index_type arraysize; int which; GFC_INTEGER_4 sh; GFC_INTEGER_4 delta; @@ -76,6 +77,7 @@ eoshift3 (gfc_array_char * const restrict ret, soffset = 0; roffset = 0; + arraysize = size0 ((array_t *) array); size = GFC_DESCRIPTOR_SIZE(array); if (pwhich) @@ -87,7 +89,7 @@ eoshift3 (gfc_array_char * const restrict ret, { int i; - ret->data = internal_malloc_size (size * size0 ((array_t *)array)); + ret->data = internal_malloc_size (size * arraysize); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) @@ -105,13 +107,26 @@ eoshift3 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } + if (arraysize > 0) + ret->data = internal_malloc_size (size * arraysize); + else + ret->data = internal_malloc_size (1); + } - else + else if (unlikely (compile_options.bounds_check)) + { + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "EOSHIFT"); + } + + if (unlikely (compile_options.bounds_check)) { - if (size0 ((array_t *) ret) == 0) - return; + bounds_reduced_extents ((array_t *) h, (array_t *) array, which, + "SHIFT argument", "EOSHIFT"); } + if (arraysize == 0) + return; extent[0] = 1; count[0] = 0; diff --git a/libgfortran/generated/eoshift3_8.c b/libgfortran/generated/eoshift3_8.c index f745a1d268f..4af36f72bb4 100644 --- a/libgfortran/generated/eoshift3_8.c +++ b/libgfortran/generated/eoshift3_8.c @@ -66,6 +66,7 @@ eoshift3 (gfc_array_char * const restrict ret, index_type len; index_type n; index_type size; + index_type arraysize; int which; GFC_INTEGER_8 sh; GFC_INTEGER_8 delta; @@ -76,6 +77,7 @@ eoshift3 (gfc_array_char * const restrict ret, soffset = 0; roffset = 0; + arraysize = size0 ((array_t *) array); size = GFC_DESCRIPTOR_SIZE(array); if (pwhich) @@ -87,7 +89,7 @@ eoshift3 (gfc_array_char * const restrict ret, { int i; - ret->data = internal_malloc_size (size * size0 ((array_t *)array)); + ret->data = internal_malloc_size (size * arraysize); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) @@ -105,13 +107,26 @@ eoshift3 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } + if (arraysize > 0) + ret->data = internal_malloc_size (size * arraysize); + else + ret->data = internal_malloc_size (1); + } - else + else if (unlikely (compile_options.bounds_check)) + { + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "EOSHIFT"); + } + + if (unlikely (compile_options.bounds_check)) { - if (size0 ((array_t *) ret) == 0) - return; + bounds_reduced_extents ((array_t *) h, (array_t *) array, which, + "SHIFT argument", "EOSHIFT"); } + if (arraysize == 0) + return; extent[0] = 1; count[0] = 0; diff --git a/libgfortran/generated/maxloc0_16_i1.c b/libgfortran/generated/maxloc0_16_i1.c index b43f08337c7..c9f58e33ea6 100644 --- a/libgfortran/generated/maxloc0_16_i1.c +++ b/libgfortran/generated/maxloc0_16_i1.c @@ -63,21 +63,8 @@ maxloc0_16_i1 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_16_i1 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_16_i1 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_16_i16.c b/libgfortran/generated/maxloc0_16_i16.c index 26941a741f9..8adbc932279 100644 --- a/libgfortran/generated/maxloc0_16_i16.c +++ b/libgfortran/generated/maxloc0_16_i16.c @@ -63,21 +63,8 @@ maxloc0_16_i16 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_16_i16 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_16_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_16_i2.c b/libgfortran/generated/maxloc0_16_i2.c index e1d329c583c..16849c27363 100644 --- a/libgfortran/generated/maxloc0_16_i2.c +++ b/libgfortran/generated/maxloc0_16_i2.c @@ -63,21 +63,8 @@ maxloc0_16_i2 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_16_i2 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_16_i2 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_16_i4.c b/libgfortran/generated/maxloc0_16_i4.c index 4d1d0a11acd..a6e979ce489 100644 --- a/libgfortran/generated/maxloc0_16_i4.c +++ b/libgfortran/generated/maxloc0_16_i4.c @@ -63,21 +63,8 @@ maxloc0_16_i4 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_16_i4 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_16_i4 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_16_i8.c b/libgfortran/generated/maxloc0_16_i8.c index 12147a0e2fa..8e2d4bc0a35 100644 --- a/libgfortran/generated/maxloc0_16_i8.c +++ b/libgfortran/generated/maxloc0_16_i8.c @@ -63,21 +63,8 @@ maxloc0_16_i8 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_16_i8 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_16_i8 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_16_r10.c b/libgfortran/generated/maxloc0_16_r10.c index 33c73083cc7..d76e947aa0d 100644 --- a/libgfortran/generated/maxloc0_16_r10.c +++ b/libgfortran/generated/maxloc0_16_r10.c @@ -63,21 +63,8 @@ maxloc0_16_r10 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_16_r10 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_16_r10 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_16_r16.c b/libgfortran/generated/maxloc0_16_r16.c index 4f4f290fee9..2e6dcf1dcfa 100644 --- a/libgfortran/generated/maxloc0_16_r16.c +++ b/libgfortran/generated/maxloc0_16_r16.c @@ -63,21 +63,8 @@ maxloc0_16_r16 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_16_r16 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_16_r16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_16_r4.c b/libgfortran/generated/maxloc0_16_r4.c index 86cedb3a420..5d1fe355faf 100644 --- a/libgfortran/generated/maxloc0_16_r4.c +++ b/libgfortran/generated/maxloc0_16_r4.c @@ -63,21 +63,8 @@ maxloc0_16_r4 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_16_r4 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_16_r4 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_16_r8.c b/libgfortran/generated/maxloc0_16_r8.c index 378024bff76..dc489f31116 100644 --- a/libgfortran/generated/maxloc0_16_r8.c +++ b/libgfortran/generated/maxloc0_16_r8.c @@ -63,21 +63,8 @@ maxloc0_16_r8 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_16_r8 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_16_r8 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_4_i1.c b/libgfortran/generated/maxloc0_4_i1.c index 7475059164c..7cdd813391e 100644 --- a/libgfortran/generated/maxloc0_4_i1.c +++ b/libgfortran/generated/maxloc0_4_i1.c @@ -63,21 +63,8 @@ maxloc0_4_i1 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_4_i1 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_4_i1 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_4_i16.c b/libgfortran/generated/maxloc0_4_i16.c index 268f09af8de..b2bc05307eb 100644 --- a/libgfortran/generated/maxloc0_4_i16.c +++ b/libgfortran/generated/maxloc0_4_i16.c @@ -63,21 +63,8 @@ maxloc0_4_i16 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_4_i16 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_4_i16 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_4_i2.c b/libgfortran/generated/maxloc0_4_i2.c index 47fb135c50d..fb3b40bd791 100644 --- a/libgfortran/generated/maxloc0_4_i2.c +++ b/libgfortran/generated/maxloc0_4_i2.c @@ -63,21 +63,8 @@ maxloc0_4_i2 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_4_i2 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_4_i2 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_4_i4.c b/libgfortran/generated/maxloc0_4_i4.c index 55bc2752131..2a84c7f4897 100644 --- a/libgfortran/generated/maxloc0_4_i4.c +++ b/libgfortran/generated/maxloc0_4_i4.c @@ -63,21 +63,8 @@ maxloc0_4_i4 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_4_i4 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_4_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_4_i8.c b/libgfortran/generated/maxloc0_4_i8.c index f598f050fd4..2e1fa6daef8 100644 --- a/libgfortran/generated/maxloc0_4_i8.c +++ b/libgfortran/generated/maxloc0_4_i8.c @@ -63,21 +63,8 @@ maxloc0_4_i8 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_4_i8 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_4_i8 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_4_r10.c b/libgfortran/generated/maxloc0_4_r10.c index 5c99198b201..934337a6ac0 100644 --- a/libgfortran/generated/maxloc0_4_r10.c +++ b/libgfortran/generated/maxloc0_4_r10.c @@ -63,21 +63,8 @@ maxloc0_4_r10 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_4_r10 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_4_r10 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_4_r16.c b/libgfortran/generated/maxloc0_4_r16.c index c7609c35dc3..c2660258a31 100644 --- a/libgfortran/generated/maxloc0_4_r16.c +++ b/libgfortran/generated/maxloc0_4_r16.c @@ -63,21 +63,8 @@ maxloc0_4_r16 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_4_r16 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_4_r16 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_4_r4.c b/libgfortran/generated/maxloc0_4_r4.c index 50f3c3b6d1a..a3499531d27 100644 --- a/libgfortran/generated/maxloc0_4_r4.c +++ b/libgfortran/generated/maxloc0_4_r4.c @@ -63,21 +63,8 @@ maxloc0_4_r4 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_4_r4 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_4_r4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_4_r8.c b/libgfortran/generated/maxloc0_4_r8.c index 30dc2976c3e..7180bf8ce60 100644 --- a/libgfortran/generated/maxloc0_4_r8.c +++ b/libgfortran/generated/maxloc0_4_r8.c @@ -63,21 +63,8 @@ maxloc0_4_r8 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_4_r8 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_4_r8 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_8_i1.c b/libgfortran/generated/maxloc0_8_i1.c index eb1737d23e3..a850603e5c5 100644 --- a/libgfortran/generated/maxloc0_8_i1.c +++ b/libgfortran/generated/maxloc0_8_i1.c @@ -63,21 +63,8 @@ maxloc0_8_i1 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_8_i1 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_8_i1 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_8_i16.c b/libgfortran/generated/maxloc0_8_i16.c index 6690c2da4b7..73683d89589 100644 --- a/libgfortran/generated/maxloc0_8_i16.c +++ b/libgfortran/generated/maxloc0_8_i16.c @@ -63,21 +63,8 @@ maxloc0_8_i16 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_8_i16 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_8_i16 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_8_i2.c b/libgfortran/generated/maxloc0_8_i2.c index b9bb230589f..3b8e793e4ce 100644 --- a/libgfortran/generated/maxloc0_8_i2.c +++ b/libgfortran/generated/maxloc0_8_i2.c @@ -63,21 +63,8 @@ maxloc0_8_i2 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_8_i2 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_8_i2 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_8_i4.c b/libgfortran/generated/maxloc0_8_i4.c index 57781469089..1b0bc42bf69 100644 --- a/libgfortran/generated/maxloc0_8_i4.c +++ b/libgfortran/generated/maxloc0_8_i4.c @@ -63,21 +63,8 @@ maxloc0_8_i4 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_8_i4 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_8_i4 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_8_i8.c b/libgfortran/generated/maxloc0_8_i8.c index ef7dedeb984..5bf95201d7c 100644 --- a/libgfortran/generated/maxloc0_8_i8.c +++ b/libgfortran/generated/maxloc0_8_i8.c @@ -63,21 +63,8 @@ maxloc0_8_i8 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_8_i8 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_8_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_8_r10.c b/libgfortran/generated/maxloc0_8_r10.c index 0c08d8e803a..28008d4a0c4 100644 --- a/libgfortran/generated/maxloc0_8_r10.c +++ b/libgfortran/generated/maxloc0_8_r10.c @@ -63,21 +63,8 @@ maxloc0_8_r10 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_8_r10 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_8_r10 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_8_r16.c b/libgfortran/generated/maxloc0_8_r16.c index da61d2b6983..04bfd57e1fc 100644 --- a/libgfortran/generated/maxloc0_8_r16.c +++ b/libgfortran/generated/maxloc0_8_r16.c @@ -63,21 +63,8 @@ maxloc0_8_r16 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_8_r16 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_8_r16 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_8_r4.c b/libgfortran/generated/maxloc0_8_r4.c index a26b110220d..238b8699bac 100644 --- a/libgfortran/generated/maxloc0_8_r4.c +++ b/libgfortran/generated/maxloc0_8_r4.c @@ -63,21 +63,8 @@ maxloc0_8_r4 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_8_r4 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_8_r4 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc0_8_r8.c b/libgfortran/generated/maxloc0_8_r8.c index 1198d624c54..16d9a45331a 100644 --- a/libgfortran/generated/maxloc0_8_r8.c +++ b/libgfortran/generated/maxloc0_8_r8.c @@ -63,21 +63,8 @@ maxloc0_8_r8 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mmaxloc0_8_r8 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MAXLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } @@ -340,22 +300,10 @@ smaxloc0_8_r8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MAXLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MAXLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/maxloc1_16_i1.c b/libgfortran/generated/maxloc1_16_i1.c index a776f4f1c7a..9be5cdd6d45 100644 --- a/libgfortran/generated/maxloc1_16_i1.c +++ b/libgfortran/generated/maxloc1_16_i1.c @@ -120,19 +120,8 @@ maxloc1_16_i1 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_16_i1 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_16_i16.c b/libgfortran/generated/maxloc1_16_i16.c index 827b3e6708c..9118f85c73c 100644 --- a/libgfortran/generated/maxloc1_16_i16.c +++ b/libgfortran/generated/maxloc1_16_i16.c @@ -120,19 +120,8 @@ maxloc1_16_i16 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_16_i16 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_16_i2.c b/libgfortran/generated/maxloc1_16_i2.c index 24a34e3343f..66b24b0fadf 100644 --- a/libgfortran/generated/maxloc1_16_i2.c +++ b/libgfortran/generated/maxloc1_16_i2.c @@ -120,19 +120,8 @@ maxloc1_16_i2 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_16_i2 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_16_i4.c b/libgfortran/generated/maxloc1_16_i4.c index 0194f28fc27..3f6c952ebe6 100644 --- a/libgfortran/generated/maxloc1_16_i4.c +++ b/libgfortran/generated/maxloc1_16_i4.c @@ -120,19 +120,8 @@ maxloc1_16_i4 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_16_i4 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_16_i8.c b/libgfortran/generated/maxloc1_16_i8.c index bb1750028f1..141dc5142ef 100644 --- a/libgfortran/generated/maxloc1_16_i8.c +++ b/libgfortran/generated/maxloc1_16_i8.c @@ -120,19 +120,8 @@ maxloc1_16_i8 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_16_i8 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_16_r10.c b/libgfortran/generated/maxloc1_16_r10.c index dc8cd5dd425..74bc4d30562 100644 --- a/libgfortran/generated/maxloc1_16_r10.c +++ b/libgfortran/generated/maxloc1_16_r10.c @@ -120,19 +120,8 @@ maxloc1_16_r10 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_16_r10 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_16_r16.c b/libgfortran/generated/maxloc1_16_r16.c index 1664edb4b35..cadca8bedb2 100644 --- a/libgfortran/generated/maxloc1_16_r16.c +++ b/libgfortran/generated/maxloc1_16_r16.c @@ -120,19 +120,8 @@ maxloc1_16_r16 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_16_r16 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_16_r4.c b/libgfortran/generated/maxloc1_16_r4.c index 58bfcc0f8ec..f2afd83ab32 100644 --- a/libgfortran/generated/maxloc1_16_r4.c +++ b/libgfortran/generated/maxloc1_16_r4.c @@ -120,19 +120,8 @@ maxloc1_16_r4 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_16_r4 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_16_r8.c b/libgfortran/generated/maxloc1_16_r8.c index d646d2547f8..3da10665b72 100644 --- a/libgfortran/generated/maxloc1_16_r8.c +++ b/libgfortran/generated/maxloc1_16_r8.c @@ -120,19 +120,8 @@ maxloc1_16_r8 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_16_r8 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_4_i1.c b/libgfortran/generated/maxloc1_4_i1.c index 39291ff4db3..3a76e0ee626 100644 --- a/libgfortran/generated/maxloc1_4_i1.c +++ b/libgfortran/generated/maxloc1_4_i1.c @@ -120,19 +120,8 @@ maxloc1_4_i1 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_4_i1 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_4_i16.c b/libgfortran/generated/maxloc1_4_i16.c index 059cacb22e5..7c3bc2dd3fb 100644 --- a/libgfortran/generated/maxloc1_4_i16.c +++ b/libgfortran/generated/maxloc1_4_i16.c @@ -120,19 +120,8 @@ maxloc1_4_i16 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_4_i16 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_4_i2.c b/libgfortran/generated/maxloc1_4_i2.c index 64cee3e8725..cdcdfa4383a 100644 --- a/libgfortran/generated/maxloc1_4_i2.c +++ b/libgfortran/generated/maxloc1_4_i2.c @@ -120,19 +120,8 @@ maxloc1_4_i2 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_4_i2 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_4_i4.c b/libgfortran/generated/maxloc1_4_i4.c index f8a843e5c5b..bf60007dd23 100644 --- a/libgfortran/generated/maxloc1_4_i4.c +++ b/libgfortran/generated/maxloc1_4_i4.c @@ -120,19 +120,8 @@ maxloc1_4_i4 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_4_i4 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_4_i8.c b/libgfortran/generated/maxloc1_4_i8.c index 293c2a9cb2e..18edc044d99 100644 --- a/libgfortran/generated/maxloc1_4_i8.c +++ b/libgfortran/generated/maxloc1_4_i8.c @@ -120,19 +120,8 @@ maxloc1_4_i8 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_4_i8 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_4_r10.c b/libgfortran/generated/maxloc1_4_r10.c index 89982795e81..bae17fe5f36 100644 --- a/libgfortran/generated/maxloc1_4_r10.c +++ b/libgfortran/generated/maxloc1_4_r10.c @@ -120,19 +120,8 @@ maxloc1_4_r10 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_4_r10 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_4_r16.c b/libgfortran/generated/maxloc1_4_r16.c index 191ba998242..811f01c2176 100644 --- a/libgfortran/generated/maxloc1_4_r16.c +++ b/libgfortran/generated/maxloc1_4_r16.c @@ -120,19 +120,8 @@ maxloc1_4_r16 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_4_r16 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_4_r4.c b/libgfortran/generated/maxloc1_4_r4.c index 1f445e7306a..065770f1a7a 100644 --- a/libgfortran/generated/maxloc1_4_r4.c +++ b/libgfortran/generated/maxloc1_4_r4.c @@ -120,19 +120,8 @@ maxloc1_4_r4 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_4_r4 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_4_r8.c b/libgfortran/generated/maxloc1_4_r8.c index 170e3dfce1a..e0835079345 100644 --- a/libgfortran/generated/maxloc1_4_r8.c +++ b/libgfortran/generated/maxloc1_4_r8.c @@ -120,19 +120,8 @@ maxloc1_4_r8 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_4_r8 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_8_i1.c b/libgfortran/generated/maxloc1_8_i1.c index 9924b718847..b1d1f0e8dc8 100644 --- a/libgfortran/generated/maxloc1_8_i1.c +++ b/libgfortran/generated/maxloc1_8_i1.c @@ -120,19 +120,8 @@ maxloc1_8_i1 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_8_i1 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_8_i16.c b/libgfortran/generated/maxloc1_8_i16.c index 97946f3dd52..3028b2de6fb 100644 --- a/libgfortran/generated/maxloc1_8_i16.c +++ b/libgfortran/generated/maxloc1_8_i16.c @@ -120,19 +120,8 @@ maxloc1_8_i16 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_8_i16 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_8_i2.c b/libgfortran/generated/maxloc1_8_i2.c index d343b0b36c3..74d7fb306b4 100644 --- a/libgfortran/generated/maxloc1_8_i2.c +++ b/libgfortran/generated/maxloc1_8_i2.c @@ -120,19 +120,8 @@ maxloc1_8_i2 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_8_i2 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_8_i4.c b/libgfortran/generated/maxloc1_8_i4.c index 682de41af38..fcf11b8ffbf 100644 --- a/libgfortran/generated/maxloc1_8_i4.c +++ b/libgfortran/generated/maxloc1_8_i4.c @@ -120,19 +120,8 @@ maxloc1_8_i4 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_8_i4 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_8_i8.c b/libgfortran/generated/maxloc1_8_i8.c index e17ecc49915..1210fb12a82 100644 --- a/libgfortran/generated/maxloc1_8_i8.c +++ b/libgfortran/generated/maxloc1_8_i8.c @@ -120,19 +120,8 @@ maxloc1_8_i8 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_8_i8 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_8_r10.c b/libgfortran/generated/maxloc1_8_r10.c index cb4b69201ee..e0873d2590e 100644 --- a/libgfortran/generated/maxloc1_8_r10.c +++ b/libgfortran/generated/maxloc1_8_r10.c @@ -120,19 +120,8 @@ maxloc1_8_r10 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_8_r10 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_8_r16.c b/libgfortran/generated/maxloc1_8_r16.c index 5a99dafa388..83d84c58ef1 100644 --- a/libgfortran/generated/maxloc1_8_r16.c +++ b/libgfortran/generated/maxloc1_8_r16.c @@ -120,19 +120,8 @@ maxloc1_8_r16 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_8_r16 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_8_r4.c b/libgfortran/generated/maxloc1_8_r4.c index ba88d8ee418..94250d30a9d 100644 --- a/libgfortran/generated/maxloc1_8_r4.c +++ b/libgfortran/generated/maxloc1_8_r4.c @@ -120,19 +120,8 @@ maxloc1_8_r4 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_8_r4 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxloc1_8_r8.c b/libgfortran/generated/maxloc1_8_r8.c index 6d05b43051d..4b759782227 100644 --- a/libgfortran/generated/maxloc1_8_r8.c +++ b/libgfortran/generated/maxloc1_8_r8.c @@ -120,19 +120,8 @@ maxloc1_8_r8 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mmaxloc1_8_r8 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXLOC"); } } diff --git a/libgfortran/generated/maxval_i1.c b/libgfortran/generated/maxval_i1.c index 10193fdf95d..cbffa3021aa 100644 --- a/libgfortran/generated/maxval_i1.c +++ b/libgfortran/generated/maxval_i1.c @@ -119,19 +119,8 @@ maxval_i1 (gfc_array_i1 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mmaxval_i1 (gfc_array_i1 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXVAL"); } } diff --git a/libgfortran/generated/maxval_i16.c b/libgfortran/generated/maxval_i16.c index 884ed6678f2..e0e53411e36 100644 --- a/libgfortran/generated/maxval_i16.c +++ b/libgfortran/generated/maxval_i16.c @@ -119,19 +119,8 @@ maxval_i16 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mmaxval_i16 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXVAL"); } } diff --git a/libgfortran/generated/maxval_i2.c b/libgfortran/generated/maxval_i2.c index 3abe6579749..293a75f57cf 100644 --- a/libgfortran/generated/maxval_i2.c +++ b/libgfortran/generated/maxval_i2.c @@ -119,19 +119,8 @@ maxval_i2 (gfc_array_i2 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mmaxval_i2 (gfc_array_i2 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXVAL"); } } diff --git a/libgfortran/generated/maxval_i4.c b/libgfortran/generated/maxval_i4.c index 57aea5fb429..4d105a0d57f 100644 --- a/libgfortran/generated/maxval_i4.c +++ b/libgfortran/generated/maxval_i4.c @@ -119,19 +119,8 @@ maxval_i4 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mmaxval_i4 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXVAL"); } } diff --git a/libgfortran/generated/maxval_i8.c b/libgfortran/generated/maxval_i8.c index 9d7f57c1cba..2ff17283e79 100644 --- a/libgfortran/generated/maxval_i8.c +++ b/libgfortran/generated/maxval_i8.c @@ -119,19 +119,8 @@ maxval_i8 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mmaxval_i8 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXVAL"); } } diff --git a/libgfortran/generated/maxval_r10.c b/libgfortran/generated/maxval_r10.c index 2259e8e2be5..356998b3027 100644 --- a/libgfortran/generated/maxval_r10.c +++ b/libgfortran/generated/maxval_r10.c @@ -119,19 +119,8 @@ maxval_r10 (gfc_array_r10 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mmaxval_r10 (gfc_array_r10 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXVAL"); } } diff --git a/libgfortran/generated/maxval_r16.c b/libgfortran/generated/maxval_r16.c index 7efdd65718c..cf281085a16 100644 --- a/libgfortran/generated/maxval_r16.c +++ b/libgfortran/generated/maxval_r16.c @@ -119,19 +119,8 @@ maxval_r16 (gfc_array_r16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mmaxval_r16 (gfc_array_r16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXVAL"); } } diff --git a/libgfortran/generated/maxval_r4.c b/libgfortran/generated/maxval_r4.c index 623c25c7f8e..b2541a2dc1b 100644 --- a/libgfortran/generated/maxval_r4.c +++ b/libgfortran/generated/maxval_r4.c @@ -119,19 +119,8 @@ maxval_r4 (gfc_array_r4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mmaxval_r4 (gfc_array_r4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXVAL"); } } diff --git a/libgfortran/generated/maxval_r8.c b/libgfortran/generated/maxval_r8.c index bdbb26f06d0..8eb0b8684fb 100644 --- a/libgfortran/generated/maxval_r8.c +++ b/libgfortran/generated/maxval_r8.c @@ -119,19 +119,8 @@ maxval_r8 (gfc_array_r8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mmaxval_r8 (gfc_array_r8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MAXVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MAXVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MAXVAL"); } } diff --git a/libgfortran/generated/minloc0_16_i1.c b/libgfortran/generated/minloc0_16_i1.c index 961beb924d3..7a505126bcd 100644 --- a/libgfortran/generated/minloc0_16_i1.c +++ b/libgfortran/generated/minloc0_16_i1.c @@ -63,21 +63,8 @@ minloc0_16_i1 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_16_i1 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_16_i1 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_16_i16.c b/libgfortran/generated/minloc0_16_i16.c index 7303592131c..cfb4115b34f 100644 --- a/libgfortran/generated/minloc0_16_i16.c +++ b/libgfortran/generated/minloc0_16_i16.c @@ -63,21 +63,8 @@ minloc0_16_i16 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_16_i16 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_16_i16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_16_i2.c b/libgfortran/generated/minloc0_16_i2.c index ee9f46c00b0..6dbbfbb5105 100644 --- a/libgfortran/generated/minloc0_16_i2.c +++ b/libgfortran/generated/minloc0_16_i2.c @@ -63,21 +63,8 @@ minloc0_16_i2 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_16_i2 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_16_i2 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_16_i4.c b/libgfortran/generated/minloc0_16_i4.c index 6d07bbe2669..811ad1fe324 100644 --- a/libgfortran/generated/minloc0_16_i4.c +++ b/libgfortran/generated/minloc0_16_i4.c @@ -63,21 +63,8 @@ minloc0_16_i4 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_16_i4 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_16_i4 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_16_i8.c b/libgfortran/generated/minloc0_16_i8.c index bbacc119ec1..583f489d30c 100644 --- a/libgfortran/generated/minloc0_16_i8.c +++ b/libgfortran/generated/minloc0_16_i8.c @@ -63,21 +63,8 @@ minloc0_16_i8 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_16_i8 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_16_i8 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_16_r10.c b/libgfortran/generated/minloc0_16_r10.c index a77efcdc5c7..fa29e93e2f5 100644 --- a/libgfortran/generated/minloc0_16_r10.c +++ b/libgfortran/generated/minloc0_16_r10.c @@ -63,21 +63,8 @@ minloc0_16_r10 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_16_r10 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_16_r10 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_16_r16.c b/libgfortran/generated/minloc0_16_r16.c index 1d29e07f297..304ca7e95fc 100644 --- a/libgfortran/generated/minloc0_16_r16.c +++ b/libgfortran/generated/minloc0_16_r16.c @@ -63,21 +63,8 @@ minloc0_16_r16 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_16_r16 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_16_r16 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_16_r4.c b/libgfortran/generated/minloc0_16_r4.c index 1c451e9f76b..0ce5e08a673 100644 --- a/libgfortran/generated/minloc0_16_r4.c +++ b/libgfortran/generated/minloc0_16_r4.c @@ -63,21 +63,8 @@ minloc0_16_r4 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_16_r4 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_16_r4 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_16_r8.c b/libgfortran/generated/minloc0_16_r8.c index d6c70869584..8346be1ff4b 100644 --- a/libgfortran/generated/minloc0_16_r8.c +++ b/libgfortran/generated/minloc0_16_r8.c @@ -63,21 +63,8 @@ minloc0_16_r8 (gfc_array_i16 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_16_r8 (gfc_array_i16 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_16_r8 (gfc_array_i16 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_4_i1.c b/libgfortran/generated/minloc0_4_i1.c index 418eb30d240..3a0b22ba71a 100644 --- a/libgfortran/generated/minloc0_4_i1.c +++ b/libgfortran/generated/minloc0_4_i1.c @@ -63,21 +63,8 @@ minloc0_4_i1 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_4_i1 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_4_i1 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_4_i16.c b/libgfortran/generated/minloc0_4_i16.c index 9a23b27e3d8..cd947eb6f05 100644 --- a/libgfortran/generated/minloc0_4_i16.c +++ b/libgfortran/generated/minloc0_4_i16.c @@ -63,21 +63,8 @@ minloc0_4_i16 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_4_i16 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_4_i16 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_4_i2.c b/libgfortran/generated/minloc0_4_i2.c index df081acb814..6d65cfb2421 100644 --- a/libgfortran/generated/minloc0_4_i2.c +++ b/libgfortran/generated/minloc0_4_i2.c @@ -63,21 +63,8 @@ minloc0_4_i2 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_4_i2 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_4_i2 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_4_i4.c b/libgfortran/generated/minloc0_4_i4.c index b076dcf5955..938d2e48208 100644 --- a/libgfortran/generated/minloc0_4_i4.c +++ b/libgfortran/generated/minloc0_4_i4.c @@ -63,21 +63,8 @@ minloc0_4_i4 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_4_i4 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_4_i4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_4_i8.c b/libgfortran/generated/minloc0_4_i8.c index 944694c5c9d..b64024e45fc 100644 --- a/libgfortran/generated/minloc0_4_i8.c +++ b/libgfortran/generated/minloc0_4_i8.c @@ -63,21 +63,8 @@ minloc0_4_i8 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_4_i8 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_4_i8 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_4_r10.c b/libgfortran/generated/minloc0_4_r10.c index 03b8fd43afb..e130e21d3c2 100644 --- a/libgfortran/generated/minloc0_4_r10.c +++ b/libgfortran/generated/minloc0_4_r10.c @@ -63,21 +63,8 @@ minloc0_4_r10 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_4_r10 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_4_r10 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_4_r16.c b/libgfortran/generated/minloc0_4_r16.c index 88059c623fe..45ccb614ecb 100644 --- a/libgfortran/generated/minloc0_4_r16.c +++ b/libgfortran/generated/minloc0_4_r16.c @@ -63,21 +63,8 @@ minloc0_4_r16 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_4_r16 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_4_r16 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_4_r4.c b/libgfortran/generated/minloc0_4_r4.c index 0b1e642ba23..6d8f74e2991 100644 --- a/libgfortran/generated/minloc0_4_r4.c +++ b/libgfortran/generated/minloc0_4_r4.c @@ -63,21 +63,8 @@ minloc0_4_r4 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_4_r4 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_4_r4 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_4_r8.c b/libgfortran/generated/minloc0_4_r8.c index a6843b1d804..eb01e685620 100644 --- a/libgfortran/generated/minloc0_4_r8.c +++ b/libgfortran/generated/minloc0_4_r8.c @@ -63,21 +63,8 @@ minloc0_4_r8 (gfc_array_i4 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_4_r8 (gfc_array_i4 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_4_r8 (gfc_array_i4 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_4) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_8_i1.c b/libgfortran/generated/minloc0_8_i1.c index 5617affe49b..d4924e48f19 100644 --- a/libgfortran/generated/minloc0_8_i1.c +++ b/libgfortran/generated/minloc0_8_i1.c @@ -63,21 +63,8 @@ minloc0_8_i1 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_8_i1 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_8_i1 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_8_i16.c b/libgfortran/generated/minloc0_8_i16.c index bc2454a1367..dad459a898f 100644 --- a/libgfortran/generated/minloc0_8_i16.c +++ b/libgfortran/generated/minloc0_8_i16.c @@ -63,21 +63,8 @@ minloc0_8_i16 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_8_i16 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_8_i16 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_8_i2.c b/libgfortran/generated/minloc0_8_i2.c index 198c9b90cb9..20cb1f20b9b 100644 --- a/libgfortran/generated/minloc0_8_i2.c +++ b/libgfortran/generated/minloc0_8_i2.c @@ -63,21 +63,8 @@ minloc0_8_i2 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_8_i2 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_8_i2 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_8_i4.c b/libgfortran/generated/minloc0_8_i4.c index c62fbcb1166..ca02f4fe379 100644 --- a/libgfortran/generated/minloc0_8_i4.c +++ b/libgfortran/generated/minloc0_8_i4.c @@ -63,21 +63,8 @@ minloc0_8_i4 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_8_i4 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_8_i4 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_8_i8.c b/libgfortran/generated/minloc0_8_i8.c index ffc790088f9..dffaec6861b 100644 --- a/libgfortran/generated/minloc0_8_i8.c +++ b/libgfortran/generated/minloc0_8_i8.c @@ -63,21 +63,8 @@ minloc0_8_i8 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_8_i8 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_8_i8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_8_r10.c b/libgfortran/generated/minloc0_8_r10.c index 68eb7b6ecab..fe31ea91ec4 100644 --- a/libgfortran/generated/minloc0_8_r10.c +++ b/libgfortran/generated/minloc0_8_r10.c @@ -63,21 +63,8 @@ minloc0_8_r10 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_8_r10 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_8_r10 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_8_r16.c b/libgfortran/generated/minloc0_8_r16.c index da7ae066704..365403c87f0 100644 --- a/libgfortran/generated/minloc0_8_r16.c +++ b/libgfortran/generated/minloc0_8_r16.c @@ -63,21 +63,8 @@ minloc0_8_r16 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_8_r16 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_8_r16 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_8_r4.c b/libgfortran/generated/minloc0_8_r4.c index fbf5bab98af..53c89b13f7f 100644 --- a/libgfortran/generated/minloc0_8_r4.c +++ b/libgfortran/generated/minloc0_8_r4.c @@ -63,21 +63,8 @@ minloc0_8_r4 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_8_r4 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_8_r4 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc0_8_r8.c b/libgfortran/generated/minloc0_8_r8.c index 2dd4cfdf406..ab553b24005 100644 --- a/libgfortran/generated/minloc0_8_r8.c +++ b/libgfortran/generated/minloc0_8_r8.c @@ -63,21 +63,8 @@ minloc0_8_r8 (gfc_array_i8 * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -186,38 +173,11 @@ mminloc0_8_r8 (gfc_array_i8 * const restrict retarray, { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in MINLOC intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } @@ -340,22 +300,10 @@ sminloc0_8_r8 (gfc_array_i8 * const restrict retarray, retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (GFC_INTEGER_8) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in MINLOC intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "MINLOC"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/generated/minloc1_16_i1.c b/libgfortran/generated/minloc1_16_i1.c index 5a5ff5e39e2..9177230a5ae 100644 --- a/libgfortran/generated/minloc1_16_i1.c +++ b/libgfortran/generated/minloc1_16_i1.c @@ -120,19 +120,8 @@ minloc1_16_i1 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_16_i1 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_16_i16.c b/libgfortran/generated/minloc1_16_i16.c index 25d4ceaae51..5ffebe29a48 100644 --- a/libgfortran/generated/minloc1_16_i16.c +++ b/libgfortran/generated/minloc1_16_i16.c @@ -120,19 +120,8 @@ minloc1_16_i16 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_16_i16 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_16_i2.c b/libgfortran/generated/minloc1_16_i2.c index 228a582ed09..f1110c1b254 100644 --- a/libgfortran/generated/minloc1_16_i2.c +++ b/libgfortran/generated/minloc1_16_i2.c @@ -120,19 +120,8 @@ minloc1_16_i2 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_16_i2 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_16_i4.c b/libgfortran/generated/minloc1_16_i4.c index c8652722a86..86c0acf5a0c 100644 --- a/libgfortran/generated/minloc1_16_i4.c +++ b/libgfortran/generated/minloc1_16_i4.c @@ -120,19 +120,8 @@ minloc1_16_i4 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_16_i4 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_16_i8.c b/libgfortran/generated/minloc1_16_i8.c index fa124441dd6..7e965bee56d 100644 --- a/libgfortran/generated/minloc1_16_i8.c +++ b/libgfortran/generated/minloc1_16_i8.c @@ -120,19 +120,8 @@ minloc1_16_i8 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_16_i8 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_16_r10.c b/libgfortran/generated/minloc1_16_r10.c index 15862a89cb5..e57462634c5 100644 --- a/libgfortran/generated/minloc1_16_r10.c +++ b/libgfortran/generated/minloc1_16_r10.c @@ -120,19 +120,8 @@ minloc1_16_r10 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_16_r10 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_16_r16.c b/libgfortran/generated/minloc1_16_r16.c index f0b452fa09d..08815d322f5 100644 --- a/libgfortran/generated/minloc1_16_r16.c +++ b/libgfortran/generated/minloc1_16_r16.c @@ -120,19 +120,8 @@ minloc1_16_r16 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_16_r16 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_16_r4.c b/libgfortran/generated/minloc1_16_r4.c index 692259db8c8..7f2967d6eb4 100644 --- a/libgfortran/generated/minloc1_16_r4.c +++ b/libgfortran/generated/minloc1_16_r4.c @@ -120,19 +120,8 @@ minloc1_16_r4 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_16_r4 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_16_r8.c b/libgfortran/generated/minloc1_16_r8.c index c0189da58f7..4d6fa8b43ee 100644 --- a/libgfortran/generated/minloc1_16_r8.c +++ b/libgfortran/generated/minloc1_16_r8.c @@ -120,19 +120,8 @@ minloc1_16_r8 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_16_r8 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_4_i1.c b/libgfortran/generated/minloc1_4_i1.c index 164f7ec31a2..107ebea06cd 100644 --- a/libgfortran/generated/minloc1_4_i1.c +++ b/libgfortran/generated/minloc1_4_i1.c @@ -120,19 +120,8 @@ minloc1_4_i1 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_4_i1 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_4_i16.c b/libgfortran/generated/minloc1_4_i16.c index 899f2029bd3..b84c52461e7 100644 --- a/libgfortran/generated/minloc1_4_i16.c +++ b/libgfortran/generated/minloc1_4_i16.c @@ -120,19 +120,8 @@ minloc1_4_i16 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_4_i16 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_4_i2.c b/libgfortran/generated/minloc1_4_i2.c index f900506de74..641b15d1d69 100644 --- a/libgfortran/generated/minloc1_4_i2.c +++ b/libgfortran/generated/minloc1_4_i2.c @@ -120,19 +120,8 @@ minloc1_4_i2 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_4_i2 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_4_i4.c b/libgfortran/generated/minloc1_4_i4.c index 7dedb8f1c5b..c1daa5771b1 100644 --- a/libgfortran/generated/minloc1_4_i4.c +++ b/libgfortran/generated/minloc1_4_i4.c @@ -120,19 +120,8 @@ minloc1_4_i4 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_4_i4 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_4_i8.c b/libgfortran/generated/minloc1_4_i8.c index 70eaefa8ed6..2229fc49a0d 100644 --- a/libgfortran/generated/minloc1_4_i8.c +++ b/libgfortran/generated/minloc1_4_i8.c @@ -120,19 +120,8 @@ minloc1_4_i8 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_4_i8 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_4_r10.c b/libgfortran/generated/minloc1_4_r10.c index 1a0bdfa7ac1..ade388b399d 100644 --- a/libgfortran/generated/minloc1_4_r10.c +++ b/libgfortran/generated/minloc1_4_r10.c @@ -120,19 +120,8 @@ minloc1_4_r10 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_4_r10 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_4_r16.c b/libgfortran/generated/minloc1_4_r16.c index b8849a56d35..e6cf58be551 100644 --- a/libgfortran/generated/minloc1_4_r16.c +++ b/libgfortran/generated/minloc1_4_r16.c @@ -120,19 +120,8 @@ minloc1_4_r16 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_4_r16 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_4_r4.c b/libgfortran/generated/minloc1_4_r4.c index cc382dba224..6aa23040294 100644 --- a/libgfortran/generated/minloc1_4_r4.c +++ b/libgfortran/generated/minloc1_4_r4.c @@ -120,19 +120,8 @@ minloc1_4_r4 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_4_r4 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_4_r8.c b/libgfortran/generated/minloc1_4_r8.c index c36567ffee6..ccc93f5e00e 100644 --- a/libgfortran/generated/minloc1_4_r8.c +++ b/libgfortran/generated/minloc1_4_r8.c @@ -120,19 +120,8 @@ minloc1_4_r8 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_4_r8 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_8_i1.c b/libgfortran/generated/minloc1_8_i1.c index 6e46c82b863..86003e572e9 100644 --- a/libgfortran/generated/minloc1_8_i1.c +++ b/libgfortran/generated/minloc1_8_i1.c @@ -120,19 +120,8 @@ minloc1_8_i1 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_8_i1 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_8_i16.c b/libgfortran/generated/minloc1_8_i16.c index 8e8410aa669..8dab74cbd1f 100644 --- a/libgfortran/generated/minloc1_8_i16.c +++ b/libgfortran/generated/minloc1_8_i16.c @@ -120,19 +120,8 @@ minloc1_8_i16 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_8_i16 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_8_i2.c b/libgfortran/generated/minloc1_8_i2.c index 2a33e3c1fb7..ba76fc1c269 100644 --- a/libgfortran/generated/minloc1_8_i2.c +++ b/libgfortran/generated/minloc1_8_i2.c @@ -120,19 +120,8 @@ minloc1_8_i2 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_8_i2 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_8_i4.c b/libgfortran/generated/minloc1_8_i4.c index 70cdef68bc6..03b57de804e 100644 --- a/libgfortran/generated/minloc1_8_i4.c +++ b/libgfortran/generated/minloc1_8_i4.c @@ -120,19 +120,8 @@ minloc1_8_i4 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_8_i4 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_8_i8.c b/libgfortran/generated/minloc1_8_i8.c index c1a01e9e436..dc1c1fff4d2 100644 --- a/libgfortran/generated/minloc1_8_i8.c +++ b/libgfortran/generated/minloc1_8_i8.c @@ -120,19 +120,8 @@ minloc1_8_i8 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_8_i8 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_8_r10.c b/libgfortran/generated/minloc1_8_r10.c index b5a6c8d2d26..15f22542ec2 100644 --- a/libgfortran/generated/minloc1_8_r10.c +++ b/libgfortran/generated/minloc1_8_r10.c @@ -120,19 +120,8 @@ minloc1_8_r10 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_8_r16.c b/libgfortran/generated/minloc1_8_r16.c index 0f4b036461d..64d1b26a7ee 100644 --- a/libgfortran/generated/minloc1_8_r16.c +++ b/libgfortran/generated/minloc1_8_r16.c @@ -120,19 +120,8 @@ minloc1_8_r16 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_8_r16 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_8_r4.c b/libgfortran/generated/minloc1_8_r4.c index 300b5bebf0d..00977886a97 100644 --- a/libgfortran/generated/minloc1_8_r4.c +++ b/libgfortran/generated/minloc1_8_r4.c @@ -120,19 +120,8 @@ minloc1_8_r4 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_8_r4 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minloc1_8_r8.c b/libgfortran/generated/minloc1_8_r8.c index da498f661ac..05359143142 100644 --- a/libgfortran/generated/minloc1_8_r8.c +++ b/libgfortran/generated/minloc1_8_r8.c @@ -120,19 +120,8 @@ minloc1_8_r8 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); } for (n = 0; n < rank; n++) @@ -313,29 +302,10 @@ mminloc1_8_r8 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINLOC intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINLOC"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINLOC"); } } diff --git a/libgfortran/generated/minval_i1.c b/libgfortran/generated/minval_i1.c index 437232a89da..3f1c0a53571 100644 --- a/libgfortran/generated/minval_i1.c +++ b/libgfortran/generated/minval_i1.c @@ -119,19 +119,8 @@ minval_i1 (gfc_array_i1 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mminval_i1 (gfc_array_i1 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINVAL"); } } diff --git a/libgfortran/generated/minval_i16.c b/libgfortran/generated/minval_i16.c index f0bd16fe003..6d0f20a7ea5 100644 --- a/libgfortran/generated/minval_i16.c +++ b/libgfortran/generated/minval_i16.c @@ -119,19 +119,8 @@ minval_i16 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mminval_i16 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINVAL"); } } diff --git a/libgfortran/generated/minval_i2.c b/libgfortran/generated/minval_i2.c index 08fd3a60b77..c09e4535450 100644 --- a/libgfortran/generated/minval_i2.c +++ b/libgfortran/generated/minval_i2.c @@ -119,19 +119,8 @@ minval_i2 (gfc_array_i2 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mminval_i2 (gfc_array_i2 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINVAL"); } } diff --git a/libgfortran/generated/minval_i4.c b/libgfortran/generated/minval_i4.c index d7e1ef93966..72c63705b50 100644 --- a/libgfortran/generated/minval_i4.c +++ b/libgfortran/generated/minval_i4.c @@ -119,19 +119,8 @@ minval_i4 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mminval_i4 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINVAL"); } } diff --git a/libgfortran/generated/minval_i8.c b/libgfortran/generated/minval_i8.c index 7b6fdc5e5ae..fbdcec9c93b 100644 --- a/libgfortran/generated/minval_i8.c +++ b/libgfortran/generated/minval_i8.c @@ -119,19 +119,8 @@ minval_i8 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mminval_i8 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINVAL"); } } diff --git a/libgfortran/generated/minval_r10.c b/libgfortran/generated/minval_r10.c index 1f6a75f0f6c..8e1ba756548 100644 --- a/libgfortran/generated/minval_r10.c +++ b/libgfortran/generated/minval_r10.c @@ -119,19 +119,8 @@ minval_r10 (gfc_array_r10 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mminval_r10 (gfc_array_r10 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINVAL"); } } diff --git a/libgfortran/generated/minval_r16.c b/libgfortran/generated/minval_r16.c index 555d86fd66f..b028029583c 100644 --- a/libgfortran/generated/minval_r16.c +++ b/libgfortran/generated/minval_r16.c @@ -119,19 +119,8 @@ minval_r16 (gfc_array_r16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mminval_r16 (gfc_array_r16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINVAL"); } } diff --git a/libgfortran/generated/minval_r4.c b/libgfortran/generated/minval_r4.c index a7f729ee732..d0236848eb1 100644 --- a/libgfortran/generated/minval_r4.c +++ b/libgfortran/generated/minval_r4.c @@ -119,19 +119,8 @@ minval_r4 (gfc_array_r4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mminval_r4 (gfc_array_r4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINVAL"); } } diff --git a/libgfortran/generated/minval_r8.c b/libgfortran/generated/minval_r8.c index 69afca1bc50..a86ce9403e0 100644 --- a/libgfortran/generated/minval_r8.c +++ b/libgfortran/generated/minval_r8.c @@ -119,19 +119,8 @@ minval_r8 (gfc_array_r8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); } for (n = 0; n < rank; n++) @@ -307,29 +296,10 @@ mminval_r8 (gfc_array_r8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " MINVAL intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "MINVAL"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "MINVAL"); } } diff --git a/libgfortran/generated/product_c10.c b/libgfortran/generated/product_c10.c index 69f7f8b7026..1f834f85d24 100644 --- a/libgfortran/generated/product_c10.c +++ b/libgfortran/generated/product_c10.c @@ -119,19 +119,8 @@ product_c10 (gfc_array_c10 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ mproduct_c10 (gfc_array_c10 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "PRODUCT"); } } diff --git a/libgfortran/generated/product_c16.c b/libgfortran/generated/product_c16.c index efaed2cebdb..20119fae10f 100644 --- a/libgfortran/generated/product_c16.c +++ b/libgfortran/generated/product_c16.c @@ -119,19 +119,8 @@ product_c16 (gfc_array_c16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ mproduct_c16 (gfc_array_c16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "PRODUCT"); } } diff --git a/libgfortran/generated/product_c4.c b/libgfortran/generated/product_c4.c index 505647ecd2e..231947f34aa 100644 --- a/libgfortran/generated/product_c4.c +++ b/libgfortran/generated/product_c4.c @@ -119,19 +119,8 @@ product_c4 (gfc_array_c4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ mproduct_c4 (gfc_array_c4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "PRODUCT"); } } diff --git a/libgfortran/generated/product_c8.c b/libgfortran/generated/product_c8.c index 16c776ad839..e6f8dbbafa1 100644 --- a/libgfortran/generated/product_c8.c +++ b/libgfortran/generated/product_c8.c @@ -119,19 +119,8 @@ product_c8 (gfc_array_c8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ mproduct_c8 (gfc_array_c8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "PRODUCT"); } } diff --git a/libgfortran/generated/product_i1.c b/libgfortran/generated/product_i1.c index cbc1ab120af..4f9b5eb3b96 100644 --- a/libgfortran/generated/product_i1.c +++ b/libgfortran/generated/product_i1.c @@ -119,19 +119,8 @@ product_i1 (gfc_array_i1 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ mproduct_i1 (gfc_array_i1 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "PRODUCT"); } } diff --git a/libgfortran/generated/product_i16.c b/libgfortran/generated/product_i16.c index e3b8c2a07e0..a23a96a8323 100644 --- a/libgfortran/generated/product_i16.c +++ b/libgfortran/generated/product_i16.c @@ -119,19 +119,8 @@ product_i16 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ mproduct_i16 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "PRODUCT"); } } diff --git a/libgfortran/generated/product_i2.c b/libgfortran/generated/product_i2.c index 507d956cb81..40bbe7233e5 100644 --- a/libgfortran/generated/product_i2.c +++ b/libgfortran/generated/product_i2.c @@ -119,19 +119,8 @@ product_i2 (gfc_array_i2 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ mproduct_i2 (gfc_array_i2 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "PRODUCT"); } } diff --git a/libgfortran/generated/product_i4.c b/libgfortran/generated/product_i4.c index d5af3679561..0510fca4aba 100644 --- a/libgfortran/generated/product_i4.c +++ b/libgfortran/generated/product_i4.c @@ -119,19 +119,8 @@ product_i4 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ mproduct_i4 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "PRODUCT"); } } diff --git a/libgfortran/generated/product_i8.c b/libgfortran/generated/product_i8.c index 3308d91dff9..b9bce58921c 100644 --- a/libgfortran/generated/product_i8.c +++ b/libgfortran/generated/product_i8.c @@ -119,19 +119,8 @@ product_i8 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ mproduct_i8 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "PRODUCT"); } } diff --git a/libgfortran/generated/product_r10.c b/libgfortran/generated/product_r10.c index 7bae90414b6..afbf756f544 100644 --- a/libgfortran/generated/product_r10.c +++ b/libgfortran/generated/product_r10.c @@ -119,19 +119,8 @@ product_r10 (gfc_array_r10 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ mproduct_r10 (gfc_array_r10 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "PRODUCT"); } } diff --git a/libgfortran/generated/product_r16.c b/libgfortran/generated/product_r16.c index bb678725d7c..1b0723ed15a 100644 --- a/libgfortran/generated/product_r16.c +++ b/libgfortran/generated/product_r16.c @@ -119,19 +119,8 @@ product_r16 (gfc_array_r16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ mproduct_r16 (gfc_array_r16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "PRODUCT"); } } diff --git a/libgfortran/generated/product_r4.c b/libgfortran/generated/product_r4.c index 333c13d2ffe..2f5a8916e45 100644 --- a/libgfortran/generated/product_r4.c +++ b/libgfortran/generated/product_r4.c @@ -119,19 +119,8 @@ product_r4 (gfc_array_r4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ mproduct_r4 (gfc_array_r4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "PRODUCT"); } } diff --git a/libgfortran/generated/product_r8.c b/libgfortran/generated/product_r8.c index 46258c00bbc..88c49ff85da 100644 --- a/libgfortran/generated/product_r8.c +++ b/libgfortran/generated/product_r8.c @@ -119,19 +119,8 @@ product_r8 (gfc_array_r8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ mproduct_r8 (gfc_array_r8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " PRODUCT intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "PRODUCT"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "PRODUCT"); } } diff --git a/libgfortran/generated/sum_c10.c b/libgfortran/generated/sum_c10.c index c63bc695266..9e32c8636b3 100644 --- a/libgfortran/generated/sum_c10.c +++ b/libgfortran/generated/sum_c10.c @@ -119,19 +119,8 @@ sum_c10 (gfc_array_c10 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ msum_c10 (gfc_array_c10 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "SUM"); } } diff --git a/libgfortran/generated/sum_c16.c b/libgfortran/generated/sum_c16.c index 9871d2d5d6a..ade7d761ceb 100644 --- a/libgfortran/generated/sum_c16.c +++ b/libgfortran/generated/sum_c16.c @@ -119,19 +119,8 @@ sum_c16 (gfc_array_c16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ msum_c16 (gfc_array_c16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "SUM"); } } diff --git a/libgfortran/generated/sum_c4.c b/libgfortran/generated/sum_c4.c index 920a6fb4920..ac37cc88ec6 100644 --- a/libgfortran/generated/sum_c4.c +++ b/libgfortran/generated/sum_c4.c @@ -119,19 +119,8 @@ sum_c4 (gfc_array_c4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ msum_c4 (gfc_array_c4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "SUM"); } } diff --git a/libgfortran/generated/sum_c8.c b/libgfortran/generated/sum_c8.c index c3e79237fb3..91db496587f 100644 --- a/libgfortran/generated/sum_c8.c +++ b/libgfortran/generated/sum_c8.c @@ -119,19 +119,8 @@ sum_c8 (gfc_array_c8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ msum_c8 (gfc_array_c8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "SUM"); } } diff --git a/libgfortran/generated/sum_i1.c b/libgfortran/generated/sum_i1.c index 913d732fa7f..b6e10909aa7 100644 --- a/libgfortran/generated/sum_i1.c +++ b/libgfortran/generated/sum_i1.c @@ -119,19 +119,8 @@ sum_i1 (gfc_array_i1 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ msum_i1 (gfc_array_i1 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "SUM"); } } diff --git a/libgfortran/generated/sum_i16.c b/libgfortran/generated/sum_i16.c index 060d45aa9ce..481ef8e51fb 100644 --- a/libgfortran/generated/sum_i16.c +++ b/libgfortran/generated/sum_i16.c @@ -119,19 +119,8 @@ sum_i16 (gfc_array_i16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ msum_i16 (gfc_array_i16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "SUM"); } } diff --git a/libgfortran/generated/sum_i2.c b/libgfortran/generated/sum_i2.c index 5318283ccb8..a0d97890d6c 100644 --- a/libgfortran/generated/sum_i2.c +++ b/libgfortran/generated/sum_i2.c @@ -119,19 +119,8 @@ sum_i2 (gfc_array_i2 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ msum_i2 (gfc_array_i2 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "SUM"); } } diff --git a/libgfortran/generated/sum_i4.c b/libgfortran/generated/sum_i4.c index e8c60c3870e..06f2dee4d7b 100644 --- a/libgfortran/generated/sum_i4.c +++ b/libgfortran/generated/sum_i4.c @@ -119,19 +119,8 @@ sum_i4 (gfc_array_i4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ msum_i4 (gfc_array_i4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "SUM"); } } diff --git a/libgfortran/generated/sum_i8.c b/libgfortran/generated/sum_i8.c index 9ee3e934bc7..9171c4c716e 100644 --- a/libgfortran/generated/sum_i8.c +++ b/libgfortran/generated/sum_i8.c @@ -119,19 +119,8 @@ sum_i8 (gfc_array_i8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ msum_i8 (gfc_array_i8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "SUM"); } } diff --git a/libgfortran/generated/sum_r10.c b/libgfortran/generated/sum_r10.c index 6a283049bfa..8d122129cc7 100644 --- a/libgfortran/generated/sum_r10.c +++ b/libgfortran/generated/sum_r10.c @@ -119,19 +119,8 @@ sum_r10 (gfc_array_r10 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ msum_r10 (gfc_array_r10 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "SUM"); } } diff --git a/libgfortran/generated/sum_r16.c b/libgfortran/generated/sum_r16.c index 35296c1d0d8..2cd6150e0f3 100644 --- a/libgfortran/generated/sum_r16.c +++ b/libgfortran/generated/sum_r16.c @@ -119,19 +119,8 @@ sum_r16 (gfc_array_r16 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ msum_r16 (gfc_array_r16 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "SUM"); } } diff --git a/libgfortran/generated/sum_r4.c b/libgfortran/generated/sum_r4.c index e7e2fe31b3a..b8a5e68e629 100644 --- a/libgfortran/generated/sum_r4.c +++ b/libgfortran/generated/sum_r4.c @@ -119,19 +119,8 @@ sum_r4 (gfc_array_r4 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ msum_r4 (gfc_array_r4 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "SUM"); } } diff --git a/libgfortran/generated/sum_r8.c b/libgfortran/generated/sum_r8.c index 86ae1092420..da9cec22372 100644 --- a/libgfortran/generated/sum_r8.c +++ b/libgfortran/generated/sum_r8.c @@ -119,19 +119,8 @@ sum_r8 (gfc_array_r8 * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); } for (n = 0; n < rank; n++) @@ -306,29 +295,10 @@ msum_r8 (gfc_array_r8 * const restrict retarray, if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " SUM intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "SUM"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "SUM"); } } diff --git a/libgfortran/intrinsics/cshift0.c b/libgfortran/intrinsics/cshift0.c index 1b7dbc1cec9..6adea76da3a 100644 --- a/libgfortran/intrinsics/cshift0.c +++ b/libgfortran/intrinsics/cshift0.c @@ -87,14 +87,17 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array, if (arraysize > 0) ret->data = internal_malloc_size (size * arraysize); else - { - ret->data = internal_malloc_size (1); - return; - } + ret->data = internal_malloc_size (1); } - + else if (unlikely (compile_options.bounds_check)) + { + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "CSHIFT"); + } + if (arraysize == 0) return; + type_size = GFC_DTYPE_TYPE_SIZE (array); switch(type_size) diff --git a/libgfortran/intrinsics/eoshift0.c b/libgfortran/intrinsics/eoshift0.c index 4b8082fdeca..74ba5ab7a97 100644 --- a/libgfortran/intrinsics/eoshift0.c +++ b/libgfortran/intrinsics/eoshift0.c @@ -54,6 +54,7 @@ eoshift0 (gfc_array_char * ret, const gfc_array_char * array, index_type dim; index_type len; index_type n; + index_type arraysize; /* The compiler cannot figure out that these are set, initialize them to avoid warnings. */ @@ -61,11 +62,12 @@ eoshift0 (gfc_array_char * ret, const gfc_array_char * array, soffset = 0; roffset = 0; + arraysize = size0 ((array_t *) array); + if (ret->data == NULL) { int i; - ret->data = internal_malloc_size (size * size0 ((array_t *)array)); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) @@ -83,13 +85,22 @@ eoshift0 (gfc_array_char * ret, const gfc_array_char * array, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } + + if (arraysize > 0) + ret->data = internal_malloc_size (size * arraysize); + else + ret->data = internal_malloc_size (1); + } - else + else if (unlikely (compile_options.bounds_check)) { - if (size0 ((array_t *) ret) == 0) - return; + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "EOSHIFT"); } + if (arraysize == 0) + return; + which = which - 1; extent[0] = 1; diff --git a/libgfortran/intrinsics/eoshift2.c b/libgfortran/intrinsics/eoshift2.c index aa5ef5ad90f..2fbf62e118c 100644 --- a/libgfortran/intrinsics/eoshift2.c +++ b/libgfortran/intrinsics/eoshift2.c @@ -75,7 +75,6 @@ eoshift2 (gfc_array_char *ret, const gfc_array_char *array, { int i; - ret->data = internal_malloc_size (size * arraysize); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) @@ -92,15 +91,20 @@ eoshift2 (gfc_array_char *ret, const gfc_array_char *array, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); + if (arraysize > 0) + ret->data = internal_malloc_size (size * arraysize); + else + ret->data = internal_malloc_size (1); + } } - else + else if (unlikely (compile_options.bounds_check)) { - if (size0 ((array_t *) ret) == 0) - return; + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "EOSHIFT"); } - if (arraysize == 0 && filler == NULL) + if (arraysize == 0) return; which = which - 1; diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h index 517ee76d91d..acb02c413b2 100644 --- a/libgfortran/libgfortran.h +++ b/libgfortran/libgfortran.h @@ -1242,6 +1242,23 @@ typedef GFC_ARRAY_DESCRIPTOR (GFC_MAX_DIMENSIONS, void) array_t; extern index_type size0 (const array_t * array); iexport_proto(size0); +/* bounds.c */ + +extern void bounds_equal_extents (array_t *, array_t *, const char *, + const char *); +internal_proto(bounds_equal_extents); + +extern void bounds_reduced_extents (array_t *, array_t *, int, const char *, + const char *intrinsic); +internal_proto(bounds_reduced_extents); + +extern void bounds_iforeach_return (array_t *, array_t *, const char *); +internal_proto(bounds_iforeach_return); + +extern void bounds_ifunction_return (array_t *, const index_type *, + const char *, const char *); +internal_proto(bounds_ifunction_return); + /* Internal auxiliary functions for cshift */ void cshift0_i1 (gfc_array_i1 *, const gfc_array_i1 *, ssize_t, int); diff --git a/libgfortran/m4/cshift1.m4 b/libgfortran/m4/cshift1.m4 index 22b61854ffe..49a4f73404a 100644 --- a/libgfortran/m4/cshift1.m4 +++ b/libgfortran/m4/cshift1.m4 @@ -99,6 +99,17 @@ cshift1 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } } + else if (unlikely (compile_options.bounds_check)) + { + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "CSHIFT"); + } + + if (unlikely (compile_options.bounds_check)) + { + bounds_reduced_extents ((array_t *) h, (array_t *) array, which, + "SHIFT argument", "CSHIFT"); + } if (arraysize == 0) return; diff --git a/libgfortran/m4/eoshift1.m4 b/libgfortran/m4/eoshift1.m4 index 831277cf413..be9b1008a60 100644 --- a/libgfortran/m4/eoshift1.m4 +++ b/libgfortran/m4/eoshift1.m4 @@ -63,6 +63,7 @@ eoshift1 (gfc_array_char * const restrict ret, index_type len; index_type n; index_type size; + index_type arraysize; int which; 'atype_name` sh; 'atype_name` delta; @@ -83,11 +84,12 @@ eoshift1 (gfc_array_char * const restrict ret, extent[0] = 1; count[0] = 0; + arraysize = size0 ((array_t *) array); if (ret->data == NULL) { int i; - ret->data = internal_malloc_size (size * size0 ((array_t *)array)); + ret->data = internal_malloc_size (size * arraysize); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) @@ -105,13 +107,27 @@ eoshift1 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } + if (arraysize > 0) + ret->data = internal_malloc_size (size * arraysize); + else + ret->data = internal_malloc_size (1); + } - else + else if (unlikely (compile_options.bounds_check)) { - if (size0 ((array_t *) ret) == 0) - return; + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "EOSHIFT"); } + if (unlikely (compile_options.bounds_check)) + { + bounds_reduced_extents ((array_t *) h, (array_t *) array, which, + "SHIFT argument", "EOSHIFT"); + } + + if (arraysize == 0) + return; + n = 0; for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++) { diff --git a/libgfortran/m4/eoshift3.m4 b/libgfortran/m4/eoshift3.m4 index e6b29599ef0..6fa3bd2f7dc 100644 --- a/libgfortran/m4/eoshift3.m4 +++ b/libgfortran/m4/eoshift3.m4 @@ -67,6 +67,7 @@ eoshift3 (gfc_array_char * const restrict ret, index_type len; index_type n; index_type size; + index_type arraysize; int which; 'atype_name` sh; 'atype_name` delta; @@ -77,6 +78,7 @@ eoshift3 (gfc_array_char * const restrict ret, soffset = 0; roffset = 0; + arraysize = size0 ((array_t *) array); size = GFC_DESCRIPTOR_SIZE(array); if (pwhich) @@ -88,7 +90,7 @@ eoshift3 (gfc_array_char * const restrict ret, { int i; - ret->data = internal_malloc_size (size * size0 ((array_t *)array)); + ret->data = internal_malloc_size (size * arraysize); ret->offset = 0; ret->dtype = array->dtype; for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++) @@ -106,13 +108,26 @@ eoshift3 (gfc_array_char * const restrict ret, GFC_DIMENSION_SET(ret->dim[i], 0, ub, str); } + if (arraysize > 0) + ret->data = internal_malloc_size (size * arraysize); + else + ret->data = internal_malloc_size (1); + } - else + else if (unlikely (compile_options.bounds_check)) + { + bounds_equal_extents ((array_t *) ret, (array_t *) array, + "return value", "EOSHIFT"); + } + + if (unlikely (compile_options.bounds_check)) { - if (size0 ((array_t *) ret) == 0) - return; + bounds_reduced_extents ((array_t *) h, (array_t *) array, which, + "SHIFT argument", "EOSHIFT"); } + if (arraysize == 0) + return; extent[0] = 1; count[0] = 0; diff --git a/libgfortran/m4/iforeach.m4 b/libgfortran/m4/iforeach.m4 index 0960d22aeb4..d86d298a3af 100644 --- a/libgfortran/m4/iforeach.m4 +++ b/libgfortran/m4/iforeach.m4 @@ -35,21 +35,8 @@ name`'rtype_qual`_'atype_code (rtype * const restrict retarray, else { if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in u_name intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " u_name intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "u_name"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); @@ -150,38 +137,11 @@ void { if (unlikely (compile_options.bounds_check)) { - int ret_rank, mask_rank; - index_type ret_extent; - int n; - index_type array_extent, mask_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in u_name intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("Incorrect extent in return value of" - " u_name intrnisic: is %ld, should be %ld", - (long int) ret_extent, (long int) rank); - - mask_rank = GFC_DESCRIPTOR_RANK (mask); - if (rank != mask_rank) - runtime_error ("rank of MASK argument in u_name intrnisic" - "should be %ld, is %ld", (long int) rank, - (long int) mask_rank); - for (n=0; n<rank; n++) - { - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " u_name intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "u_name"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "u_name"); } } @@ -303,22 +263,10 @@ void retarray->offset = 0; retarray->data = internal_malloc_size (sizeof (rtype_name) * rank); } - else + else if (unlikely (compile_options.bounds_check)) { - if (unlikely (compile_options.bounds_check)) - { - int ret_rank; - index_type ret_extent; - - ret_rank = GFC_DESCRIPTOR_RANK (retarray); - if (ret_rank != 1) - runtime_error ("rank of return array in u_name intrinsic" - " should be 1, is %ld", (long int) ret_rank); - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); - if (ret_extent != rank) - runtime_error ("dimension of return array incorrect"); - } + bounds_iforeach_return ((array_t *) retarray, (array_t *) array, + "u_name"); } dstride = GFC_DESCRIPTOR_STRIDE(retarray,0); diff --git a/libgfortran/m4/ifunction.m4 b/libgfortran/m4/ifunction.m4 index 6785eb3c43f..66b1d98b1ad 100644 --- a/libgfortran/m4/ifunction.m4 +++ b/libgfortran/m4/ifunction.m4 @@ -107,19 +107,8 @@ name`'rtype_qual`_'atype_code (rtype * const restrict retarray, (long int) rank); if (unlikely (compile_options.bounds_check)) - { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " u_name intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "u_name"); } for (n = 0; n < rank; n++) @@ -294,29 +283,10 @@ void if (unlikely (compile_options.bounds_check)) { - for (n=0; n < rank; n++) - { - index_type ret_extent; - - ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,n); - if (extent[n] != ret_extent) - runtime_error ("Incorrect extent in return value of" - " u_name intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) ret_extent, (long int) extent[n]); - } - for (n=0; n<= rank; n++) - { - index_type mask_extent, array_extent; - - array_extent = GFC_DESCRIPTOR_EXTENT(array,n); - mask_extent = GFC_DESCRIPTOR_EXTENT(mask,n); - if (array_extent != mask_extent) - runtime_error ("Incorrect extent in MASK argument of" - " u_name intrinsic in dimension %ld:" - " is %ld, should be %ld", (long int) n + 1, - (long int) mask_extent, (long int) array_extent); - } + bounds_ifunction_return ((array_t *) retarray, extent, + "return value", "u_name"); + bounds_equal_extents ((array_t *) mask, (array_t *) array, + "MASK argument", "u_name"); } } diff --git a/libgfortran/runtime/bounds.c b/libgfortran/runtime/bounds.c new file mode 100644 index 00000000000..8a7affd2e18 --- /dev/null +++ b/libgfortran/runtime/bounds.c @@ -0,0 +1,199 @@ +/* Copyright (C) 2009 + Free Software Foundation, Inc. + Contributed by Thomas Koenig + +This file is part of the GNU Fortran runtime library (libgfortran). + +Libgfortran is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +Libgfortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +<http://www.gnu.org/licenses/>. */ + +#include "libgfortran.h" +#include <assert.h> + +/* Auxiliary functions for bounds checking, mostly to reduce library size. */ + +/* Bounds checking for the return values of the iforeach functions (such + as maxloc and minloc). The extent of ret_array must + must match the rank of array. */ + +void +bounds_iforeach_return (array_t *retarray, array_t *array, const char *name) +{ + index_type rank; + index_type ret_rank; + index_type ret_extent; + + ret_rank = GFC_DESCRIPTOR_RANK (retarray); + + if (ret_rank != 1) + runtime_error ("Incorrect rank of return array in %s intrinsic:" + "is %ld, should be 1", name, (long int) ret_rank); + + rank = GFC_DESCRIPTOR_RANK (array); + ret_extent = GFC_DESCRIPTOR_EXTENT(retarray,0); + if (ret_extent != rank) + runtime_error ("Incorrect extent in return value of" + " %s intrinsic: is %ld, should be %ld", + name, (long int) ret_extent, (long int) rank); + +} + +/* Check the return of functions generated from ifunction.m4. + We check the array descriptor "a" against the extents precomputed + from ifunction.m4, and complain about the argument a_name in the + intrinsic function. */ + +void +bounds_ifunction_return (array_t * a, const index_type * extent, + const char * a_name, const char * intrinsic) +{ + int empty; + int n; + int rank; + index_type a_size; + + rank = GFC_DESCRIPTOR_RANK (a); + a_size = size0 (a); + + empty = 0; + for (n = 0; n < rank; n++) + { + if (extent[n] == 0) + empty = 1; + } + if (empty) + { + if (a_size != 0) + runtime_error ("Incorrect size in %s of %s" + " intrinsic: should be zero-sized", + a_name, intrinsic); + } + else + { + if (a_size == 0) + runtime_error ("Incorrect size of %s in %s" + " intrinsic: should not be zero-sized", + a_name, intrinsic); + + for (n = 0; n < rank; n++) + { + index_type a_extent; + a_extent = GFC_DESCRIPTOR_EXTENT(a, n); + if (a_extent != extent[n]) + runtime_error("Incorrect extent in %s of %s" + " intrinsic in dimension %ld: is %ld," + " should be %ld", a_name, intrinsic, (long int) n + 1, + (long int) a_extent, (long int) extent[n]); + + } + } +} + +/* Check that two arrays have equal extents, or are both zero-sized. Abort + with a runtime error if this is not the case. Complain that a has the + wrong size. */ + +void +bounds_equal_extents (array_t *a, array_t *b, const char *a_name, + const char *intrinsic) +{ + index_type a_size, b_size, n; + + assert (GFC_DESCRIPTOR_RANK(a) == GFC_DESCRIPTOR_RANK(b)); + + a_size = size0 (a); + b_size = size0 (b); + + if (b_size == 0) + { + if (a_size != 0) + runtime_error ("Incorrect size of %s in %s" + " intrinsic: should be zero-sized", + a_name, intrinsic); + } + else + { + if (a_size == 0) + runtime_error ("Incorrect size of %s of %s" + " intrinsic: Should not be zero-sized", + a_name, intrinsic); + + for (n = 0; n < GFC_DESCRIPTOR_RANK (b); n++) + { + index_type a_extent, b_extent; + + a_extent = GFC_DESCRIPTOR_EXTENT(a, n); + b_extent = GFC_DESCRIPTOR_EXTENT(b, n); + if (a_extent != b_extent) + runtime_error("Incorrect extent in %s of %s" + " intrinsic in dimension %ld: is %ld," + " should be %ld", a_name, intrinsic, (long int) n + 1, + (long int) a_extent, (long int) b_extent); + } + } +} + +/* Check that the extents of a and b agree, except that a has a missing + dimension in argument which. Complain about a if anything is wrong. */ + +void +bounds_reduced_extents (array_t *a, array_t *b, int which, const char *a_name, + const char *intrinsic) +{ + + index_type i, n, a_size, b_size; + + assert (GFC_DESCRIPTOR_RANK(a) == GFC_DESCRIPTOR_RANK(b) - 1); + + a_size = size0 (a); + b_size = size0 (b); + + if (b_size == 0) + { + if (a_size != 0) + runtime_error ("Incorrect size in %s of %s" + " intrinsic: should not be zero-sized", + a_name, intrinsic); + } + else + { + if (a_size == 0) + runtime_error ("Incorrect size of %s of %s" + " intrinsic: should be zero-sized", + a_name, intrinsic); + + i = 0; + for (n = 0; n < GFC_DESCRIPTOR_RANK (b); n++) + { + index_type a_extent, b_extent; + + if (n != which) + { + a_extent = GFC_DESCRIPTOR_EXTENT(a, i); + b_extent = GFC_DESCRIPTOR_EXTENT(b, n); + if (a_extent != b_extent) + runtime_error("Incorrect extent in %s of %s" + " intrinsic in dimension %ld: is %ld," + " should be %ld", a_name, intrinsic, (long int) i + 1, + (long int) a_extent, (long int) b_extent); + i++; + } + } + } +} |