summaryrefslogtreecommitdiffstats
path: root/libgfortran/generated/maxloc1_4_i4.c
diff options
context:
space:
mode:
authorpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-04 14:30:46 +0000
committerpbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-04 14:30:46 +0000
commit5fcc57ced0054855920854726836938ace1573c9 (patch)
tree4227da0c8f70c91f8b20b53d9be0ca661b7f838a /libgfortran/generated/maxloc1_4_i4.c
parent90b0414cbc5cef048c8460ac715ac933fcc4c16b (diff)
downloadppe42-gcc-5fcc57ced0054855920854726836938ace1573c9.tar.gz
ppe42-gcc-5fcc57ced0054855920854726836938ace1573c9.zip
* 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/maxloc1_4_i4.c')
-rw-r--r--libgfortran/generated/maxloc1_4_i4.c17
1 files changed, 17 insertions, 0 deletions
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;
OpenPOWER on IntegriCloud