diff options
author | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-04 14:30:46 +0000 |
---|---|---|
committer | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-04 14:30:46 +0000 |
commit | 5fcc57ced0054855920854726836938ace1573c9 (patch) | |
tree | 4227da0c8f70c91f8b20b53d9be0ca661b7f838a /libgfortran/generated | |
parent | 90b0414cbc5cef048c8460ac715ac933fcc4c16b (diff) | |
download | gcc-5fcc57ced0054855920854726836938ace1573c9.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85558 138bc75d-0d04-0410-961f-82ee72b054a4
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 3ad6a3d43f9..671684fa57f 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 a407a65011b..3f418ccc45f 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 0d79ce72e30..64cd6757a48 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 e6ac3f5919d..c9f418dcd07 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 f3087e45442..626ebf944e7 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 92c1b2f76a3..2db569aac50 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 4944eb2cfd3..dadbc96fb4e 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 7d7f4b5c032..d453e01e45b 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 dff8627c974..f2a3718482a 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 dbb3cd0a787..25a93bae5e5 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 d44c556eea6..5dbf0e6442e 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 4fe00d60f23..90b81865128 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 794c6f6936f..a705e79d794 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 f755afb90d9..5edd7d480a5 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 8e26f1c3549..5476736e205 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 5955f198979..0fba535c975 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 d130156b57d..90fc202331d 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 3645346286a..9746503707b 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 6e82ad68dfb..de999ab390e 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 34359d61984..fa357b443fa 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 7cd7dd1a2dd..be9ae2e452d 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 bbbb02fc7f3..2f17baacbf0 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 e59427bd184..7f3449f716b 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 77b3fabeb7c..226d7271c06 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 1e1c0e1593f..1d1c3d406aa 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 6b7d5267deb..f7b46c17cf7 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 4d088a160f3..d71d05621ea 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 66a1c120749..7de9a2e0377 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 70f9b981dfe..e2e68237601 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 bfac7bad5ff..4b7bac6b532 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 0dd156b5816..8d4e49055be 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 99cd6873d27..8300f749681 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 e4df38bebf2..c69295123ef 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 427043751ae..68a678586bb 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 b8fb8793143..889d4c1bd67 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 210e61792c7..74e0459c6b9 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 c615bbd33da..e18139d6b1b 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 4d12052be86..ce29c1a8ca2 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 91c4e84bf9b..36e20e2e81c 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 4ab3e5e36d8..971c597341e 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 2d737a1f661..628a07756f4 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 42dfd9f38d6..536719dd7e4 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 293b30edb43..611a1131739 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 294c7980ff7..bdc93e0e47a 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 184243f21d4..930aad9f07d 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 2dcaa000889..c4554e6c210 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) |