summaryrefslogtreecommitdiff
path: root/libgfortran/generated/minloc1_4_r4.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/generated/minloc1_4_r4.c')
-rw-r--r--libgfortran/generated/minloc1_4_r4.c17
1 files changed, 17 insertions, 0 deletions
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;