diff options
author | Victor Leikehman <lei@il.ibm.com> | 2004-08-04 14:30:46 +0000 |
---|---|---|
committer | Paul Brook <pbrook@gcc.gnu.org> | 2004-08-04 14:30:46 +0000 |
commit | 6c167c45b1059150631362a647864ee0ca900a91 (patch) | |
tree | 4227da0c8f70c91f8b20b53d9be0ca661b7f838a /libgfortran/generated | |
parent | 2acc29bdd3bc49da5eca42a0f1c014f972e9ef20 (diff) | |
download | gcc-6c167c45b1059150631362a647864ee0ca900a91.zip gcc-6c167c45b1059150631362a647864ee0ca900a91.tar.gz gcc-6c167c45b1059150631362a647864ee0ca900a91.tar.bz2 |
* libgfortran.h (array_t, size0) New declarations.
* m4/ifunction.m4, m4/transpose.m4, intrinsics/cshift0.c: Allocate
space if return value descriptor has NULL in its data field,
and initialize bounds and stride.
* intrinsics/size.c (array_t, size0): Declarations moved to
libgfortran.h.
* generated/*.c: Regenerate.
From-SVN: r85558
Diffstat (limited to 'libgfortran/generated')
46 files changed, 778 insertions, 0 deletions
diff --git a/libgfortran/generated/all_l4.c b/libgfortran/generated/all_l4.c index 3ad6a3d..671684f 100644 --- a/libgfortran/generated/all_l4.c +++ b/libgfortran/generated/all_l4.c @@ -63,6 +63,23 @@ __all_l4 (gfc_array_l4 * retarray, gfc_array_l4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_LOGICAL_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/all_l8.c b/libgfortran/generated/all_l8.c index a407a65..3f418cc 100644 --- a/libgfortran/generated/all_l8.c +++ b/libgfortran/generated/all_l8.c @@ -63,6 +63,23 @@ __all_l8 (gfc_array_l8 * retarray, gfc_array_l8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_LOGICAL_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/any_l4.c b/libgfortran/generated/any_l4.c index 0d79ce7..64cd675 100644 --- a/libgfortran/generated/any_l4.c +++ b/libgfortran/generated/any_l4.c @@ -63,6 +63,23 @@ __any_l4 (gfc_array_l4 * retarray, gfc_array_l4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_LOGICAL_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/any_l8.c b/libgfortran/generated/any_l8.c index e6ac3f5..c9f418d 100644 --- a/libgfortran/generated/any_l8.c +++ b/libgfortran/generated/any_l8.c @@ -63,6 +63,23 @@ __any_l8 (gfc_array_l8 * retarray, gfc_array_l8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_LOGICAL_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/count_4_l4.c b/libgfortran/generated/count_4_l4.c index f3087e4..626ebf9 100644 --- a/libgfortran/generated/count_4_l4.c +++ b/libgfortran/generated/count_4_l4.c @@ -63,6 +63,23 @@ __count_4_l4 (gfc_array_i4 * retarray, gfc_array_l4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/count_4_l8.c b/libgfortran/generated/count_4_l8.c index 92c1b2f..2db569a 100644 --- a/libgfortran/generated/count_4_l8.c +++ b/libgfortran/generated/count_4_l8.c @@ -63,6 +63,23 @@ __count_4_l8 (gfc_array_i4 * retarray, gfc_array_l8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/count_8_l4.c b/libgfortran/generated/count_8_l4.c index 4944eb2..dadbc96 100644 --- a/libgfortran/generated/count_8_l4.c +++ b/libgfortran/generated/count_8_l4.c @@ -63,6 +63,23 @@ __count_8_l4 (gfc_array_i8 * retarray, gfc_array_l4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/count_8_l8.c b/libgfortran/generated/count_8_l8.c index 7d7f4b5..d453e01 100644 --- a/libgfortran/generated/count_8_l8.c +++ b/libgfortran/generated/count_8_l8.c @@ -63,6 +63,23 @@ __count_8_l8 (gfc_array_i8 * retarray, gfc_array_l8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/maxloc1_4_i4.c b/libgfortran/generated/maxloc1_4_i4.c index dff8627..f2a3718 100644 --- a/libgfortran/generated/maxloc1_4_i4.c +++ b/libgfortran/generated/maxloc1_4_i4.c @@ -65,6 +65,23 @@ __maxloc1_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/maxloc1_4_i8.c b/libgfortran/generated/maxloc1_4_i8.c index dbb3cd0..25a93ba 100644 --- a/libgfortran/generated/maxloc1_4_i8.c +++ b/libgfortran/generated/maxloc1_4_i8.c @@ -65,6 +65,23 @@ __maxloc1_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/maxloc1_4_r4.c b/libgfortran/generated/maxloc1_4_r4.c index d44c556..5dbf0e6 100644 --- a/libgfortran/generated/maxloc1_4_r4.c +++ b/libgfortran/generated/maxloc1_4_r4.c @@ -65,6 +65,23 @@ __maxloc1_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/maxloc1_4_r8.c b/libgfortran/generated/maxloc1_4_r8.c index 4fe00d6..90b8186 100644 --- a/libgfortran/generated/maxloc1_4_r8.c +++ b/libgfortran/generated/maxloc1_4_r8.c @@ -65,6 +65,23 @@ __maxloc1_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/maxloc1_8_i4.c b/libgfortran/generated/maxloc1_8_i4.c index 794c6f6..a705e79 100644 --- a/libgfortran/generated/maxloc1_8_i4.c +++ b/libgfortran/generated/maxloc1_8_i4.c @@ -65,6 +65,23 @@ __maxloc1_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/maxloc1_8_i8.c b/libgfortran/generated/maxloc1_8_i8.c index f755afb..5edd7d4 100644 --- a/libgfortran/generated/maxloc1_8_i8.c +++ b/libgfortran/generated/maxloc1_8_i8.c @@ -65,6 +65,23 @@ __maxloc1_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/maxloc1_8_r4.c b/libgfortran/generated/maxloc1_8_r4.c index 8e26f1c..5476736 100644 --- a/libgfortran/generated/maxloc1_8_r4.c +++ b/libgfortran/generated/maxloc1_8_r4.c @@ -65,6 +65,23 @@ __maxloc1_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/maxloc1_8_r8.c b/libgfortran/generated/maxloc1_8_r8.c index 5955f19..0fba535 100644 --- a/libgfortran/generated/maxloc1_8_r8.c +++ b/libgfortran/generated/maxloc1_8_r8.c @@ -65,6 +65,23 @@ __maxloc1_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/maxval_i4.c b/libgfortran/generated/maxval_i4.c index d130156..90fc202 100644 --- a/libgfortran/generated/maxval_i4.c +++ b/libgfortran/generated/maxval_i4.c @@ -64,6 +64,23 @@ __maxval_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/maxval_i8.c b/libgfortran/generated/maxval_i8.c index 3645346..9746503 100644 --- a/libgfortran/generated/maxval_i8.c +++ b/libgfortran/generated/maxval_i8.c @@ -64,6 +64,23 @@ __maxval_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/maxval_r4.c b/libgfortran/generated/maxval_r4.c index 6e82ad6..de999ab 100644 --- a/libgfortran/generated/maxval_r4.c +++ b/libgfortran/generated/maxval_r4.c @@ -64,6 +64,23 @@ __maxval_r4 (gfc_array_r4 * retarray, gfc_array_r4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_REAL_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/maxval_r8.c b/libgfortran/generated/maxval_r8.c index 34359d6..fa357b4 100644 --- a/libgfortran/generated/maxval_r8.c +++ b/libgfortran/generated/maxval_r8.c @@ -64,6 +64,23 @@ __maxval_r8 (gfc_array_r8 * retarray, gfc_array_r8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_REAL_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/minloc1_4_i4.c b/libgfortran/generated/minloc1_4_i4.c index 7cd7dd1..be9ae2e 100644 --- a/libgfortran/generated/minloc1_4_i4.c +++ b/libgfortran/generated/minloc1_4_i4.c @@ -65,6 +65,23 @@ __minloc1_4_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/minloc1_4_i8.c b/libgfortran/generated/minloc1_4_i8.c index bbbb02f..2f17baa 100644 --- a/libgfortran/generated/minloc1_4_i8.c +++ b/libgfortran/generated/minloc1_4_i8.c @@ -65,6 +65,23 @@ __minloc1_4_i8 (gfc_array_i4 * retarray, gfc_array_i8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/minloc1_4_r4.c b/libgfortran/generated/minloc1_4_r4.c index e59427b..7f3449f 100644 --- a/libgfortran/generated/minloc1_4_r4.c +++ b/libgfortran/generated/minloc1_4_r4.c @@ -65,6 +65,23 @@ __minloc1_4_r4 (gfc_array_i4 * retarray, gfc_array_r4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/minloc1_4_r8.c b/libgfortran/generated/minloc1_4_r8.c index 77b3fab..226d727 100644 --- a/libgfortran/generated/minloc1_4_r8.c +++ b/libgfortran/generated/minloc1_4_r8.c @@ -65,6 +65,23 @@ __minloc1_4_r8 (gfc_array_i4 * retarray, gfc_array_r8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/minloc1_8_i4.c b/libgfortran/generated/minloc1_8_i4.c index 1e1c0e1..1d1c3d4 100644 --- a/libgfortran/generated/minloc1_8_i4.c +++ b/libgfortran/generated/minloc1_8_i4.c @@ -65,6 +65,23 @@ __minloc1_8_i4 (gfc_array_i8 * retarray, gfc_array_i4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/minloc1_8_i8.c b/libgfortran/generated/minloc1_8_i8.c index 6b7d526..f7b46c1 100644 --- a/libgfortran/generated/minloc1_8_i8.c +++ b/libgfortran/generated/minloc1_8_i8.c @@ -65,6 +65,23 @@ __minloc1_8_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/minloc1_8_r4.c b/libgfortran/generated/minloc1_8_r4.c index 4d088a1..d71d056 100644 --- a/libgfortran/generated/minloc1_8_r4.c +++ b/libgfortran/generated/minloc1_8_r4.c @@ -65,6 +65,23 @@ __minloc1_8_r4 (gfc_array_i8 * retarray, gfc_array_r4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/minloc1_8_r8.c b/libgfortran/generated/minloc1_8_r8.c index 66a1c12..7de9a2e 100644 --- a/libgfortran/generated/minloc1_8_r8.c +++ b/libgfortran/generated/minloc1_8_r8.c @@ -65,6 +65,23 @@ __minloc1_8_r8 (gfc_array_i8 * retarray, gfc_array_r8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/minval_i4.c b/libgfortran/generated/minval_i4.c index 70f9b98..e2e6823 100644 --- a/libgfortran/generated/minval_i4.c +++ b/libgfortran/generated/minval_i4.c @@ -64,6 +64,23 @@ __minval_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/minval_i8.c b/libgfortran/generated/minval_i8.c index bfac7ba..4b7bac6 100644 --- a/libgfortran/generated/minval_i8.c +++ b/libgfortran/generated/minval_i8.c @@ -64,6 +64,23 @@ __minval_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/minval_r4.c b/libgfortran/generated/minval_r4.c index 0dd156b..8d4e490 100644 --- a/libgfortran/generated/minval_r4.c +++ b/libgfortran/generated/minval_r4.c @@ -64,6 +64,23 @@ __minval_r4 (gfc_array_r4 * retarray, gfc_array_r4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_REAL_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/minval_r8.c b/libgfortran/generated/minval_r8.c index 99cd687..8300f74 100644 --- a/libgfortran/generated/minval_r8.c +++ b/libgfortran/generated/minval_r8.c @@ -64,6 +64,23 @@ __minval_r8 (gfc_array_r8 * retarray, gfc_array_r8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_REAL_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/product_c4.c b/libgfortran/generated/product_c4.c index e4df38b..c692951 100644 --- a/libgfortran/generated/product_c4.c +++ b/libgfortran/generated/product_c4.c @@ -63,6 +63,23 @@ __product_c4 (gfc_array_c4 * retarray, gfc_array_c4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_COMPLEX_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/product_c8.c b/libgfortran/generated/product_c8.c index 4270437..68a6785 100644 --- a/libgfortran/generated/product_c8.c +++ b/libgfortran/generated/product_c8.c @@ -63,6 +63,23 @@ __product_c8 (gfc_array_c8 * retarray, gfc_array_c8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_COMPLEX_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/product_i4.c b/libgfortran/generated/product_i4.c index b8fb879..889d4c1 100644 --- a/libgfortran/generated/product_i4.c +++ b/libgfortran/generated/product_i4.c @@ -63,6 +63,23 @@ __product_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/product_i8.c b/libgfortran/generated/product_i8.c index 210e617..74e0459 100644 --- a/libgfortran/generated/product_i8.c +++ b/libgfortran/generated/product_i8.c @@ -63,6 +63,23 @@ __product_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/product_r4.c b/libgfortran/generated/product_r4.c index c615bbd..e18139d 100644 --- a/libgfortran/generated/product_r4.c +++ b/libgfortran/generated/product_r4.c @@ -63,6 +63,23 @@ __product_r4 (gfc_array_r4 * retarray, gfc_array_r4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_REAL_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/product_r8.c b/libgfortran/generated/product_r8.c index 4d12052..ce29c1a 100644 --- a/libgfortran/generated/product_r8.c +++ b/libgfortran/generated/product_r8.c @@ -63,6 +63,23 @@ __product_r8 (gfc_array_r8 * retarray, gfc_array_r8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_REAL_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/sum_c4.c b/libgfortran/generated/sum_c4.c index 91c4e84..36e20e2 100644 --- a/libgfortran/generated/sum_c4.c +++ b/libgfortran/generated/sum_c4.c @@ -63,6 +63,23 @@ __sum_c4 (gfc_array_c4 * retarray, gfc_array_c4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_COMPLEX_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/sum_c8.c b/libgfortran/generated/sum_c8.c index 4ab3e5e..971c597 100644 --- a/libgfortran/generated/sum_c8.c +++ b/libgfortran/generated/sum_c8.c @@ -63,6 +63,23 @@ __sum_c8 (gfc_array_c8 * retarray, gfc_array_c8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_COMPLEX_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/sum_i4.c b/libgfortran/generated/sum_i4.c index 2d737a1..628a077 100644 --- a/libgfortran/generated/sum_i4.c +++ b/libgfortran/generated/sum_i4.c @@ -63,6 +63,23 @@ __sum_i4 (gfc_array_i4 * retarray, gfc_array_i4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/sum_i8.c b/libgfortran/generated/sum_i8.c index 42dfd9f..536719d 100644 --- a/libgfortran/generated/sum_i8.c +++ b/libgfortran/generated/sum_i8.c @@ -63,6 +63,23 @@ __sum_i8 (gfc_array_i8 * retarray, gfc_array_i8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/sum_r4.c b/libgfortran/generated/sum_r4.c index 293b30e..611a113 100644 --- a/libgfortran/generated/sum_r4.c +++ b/libgfortran/generated/sum_r4.c @@ -63,6 +63,23 @@ __sum_r4 (gfc_array_r4 * retarray, gfc_array_r4 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_REAL_4) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/sum_r8.c b/libgfortran/generated/sum_r8.c index 294c798..bdc93e0 100644 --- a/libgfortran/generated/sum_r8.c +++ b/libgfortran/generated/sum_r8.c @@ -63,6 +63,23 @@ __sum_r8 (gfc_array_r8 * retarray, gfc_array_r8 *array, index_type *pdim) array->dim[n + 1].ubound + 1 - array->dim[n + 1].lbound; } + if (retarray->data == NULL) + { + for (n = 0; n < rank; n++) + { + retarray->dim[n].lbound = 0; + retarray->dim[n].ubound = extent[n]-1; + if (n == 0) + retarray->dim[n].stride = 1; + else + retarray->dim[n].stride = retarray->dim[n-1].stride * extent[n-1]; + } + + retarray->data = internal_malloc (sizeof (GFC_REAL_8) * + (retarray->dim[rank-1].stride * extent[rank-1])); + retarray->base = 0; + } + for (n = 0; n < rank; n++) { count[n] = 0; diff --git a/libgfortran/generated/transpose_i4.c b/libgfortran/generated/transpose_i4.c index 184243f..930aad9 100644 --- a/libgfortran/generated/transpose_i4.c +++ b/libgfortran/generated/transpose_i4.c @@ -38,6 +38,21 @@ __transpose_4 (gfc_array_i4 * ret, gfc_array_i4 * source) assert (GFC_DESCRIPTOR_RANK (source) == 2); + if (ret->data == NULL) + { + ret->data = internal_malloc (sizeof (GFC_INTEGER_4) * size0 (source)); + ret->base = 0; + ret->dtype = source->dtype; + + ret->dim[0].lbound = 0; + ret->dim[0].ubound = source->dim[1].ubound - source->dim[1].lbound; + ret->dim[0].stride = 1; + + ret->dim[1].lbound = 0; + ret->dim[1].ubound = source->dim[0].ubound - source->dim[0].lbound; + ret->dim[1].stride = ret->dim[0].ubound+1; + } + if (ret->dim[0].stride == 0) ret->dim[0].stride = 1; if (source->dim[0].stride == 0) diff --git a/libgfortran/generated/transpose_i8.c b/libgfortran/generated/transpose_i8.c index 2dcaa00..c4554e6 100644 --- a/libgfortran/generated/transpose_i8.c +++ b/libgfortran/generated/transpose_i8.c @@ -38,6 +38,21 @@ __transpose_8 (gfc_array_i8 * ret, gfc_array_i8 * source) assert (GFC_DESCRIPTOR_RANK (source) == 2); + if (ret->data == NULL) + { + ret->data = internal_malloc (sizeof (GFC_INTEGER_8) * size0 (source)); + ret->base = 0; + ret->dtype = source->dtype; + + ret->dim[0].lbound = 0; + ret->dim[0].ubound = source->dim[1].ubound - source->dim[1].lbound; + ret->dim[0].stride = 1; + + ret->dim[1].lbound = 0; + ret->dim[1].ubound = source->dim[0].ubound - source->dim[0].lbound; + ret->dim[1].stride = ret->dim[0].ubound+1; + } + if (ret->dim[0].stride == 0) ret->dim[0].stride = 1; if (source->dim[0].stride == 0) |