diff options
author | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-09 14:34:39 +0000 |
---|---|---|
committer | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-09 14:34:39 +0000 |
commit | 4a43abf441a036d532431adc18f417c5ebe5056a (patch) | |
tree | c587895dd83e037b88dc7cd3d97ecb67add9aa8f /libgfortran/generated/matmul_i8.c | |
parent | b580b4a241d3a3999f3034e1bc7973a1c4122e6d (diff) | |
download | ppe42-gcc-4a43abf441a036d532431adc18f417c5ebe5056a.tar.gz ppe42-gcc-4a43abf441a036d532431adc18f417c5ebe5056a.zip |
2004-09-09 Victor Leikehman <lei@il.ibm.com>
* m4/matmul.m4, m4/matmull.m4, intrinsics/eoshift0.c,
intrinsics/eoshift2.c, intrinsics/transpose_generic.c:
Allocate space if return value has NULL in its data field.
* generated/*.c: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85717 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/generated/matmul_i8.c')
-rw-r--r-- | libgfortran/generated/matmul_i8.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/libgfortran/generated/matmul_i8.c b/libgfortran/generated/matmul_i8.c index 1ca78276478..1a8e8dcb6b9 100644 --- a/libgfortran/generated/matmul_i8.c +++ b/libgfortran/generated/matmul_i8.c @@ -2,7 +2,7 @@ Copyright 2002 Free Software Foundation, Inc. Contributed by Paul Brook <paul@nowt.org> -This file is part of the GNU Fortran 95 runtime library (libgfor). +This file is part of the GNU Fortran 95 runtime library (libgfortran). Libgfortran is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -51,6 +51,36 @@ __matmul_i8 (gfc_array_i8 * retarray, gfc_array_i8 * a, gfc_array_i8 * b) assert (GFC_DESCRIPTOR_RANK (a) == 2 || GFC_DESCRIPTOR_RANK (b) == 2); + + if (retarray->data == NULL) + { + if (GFC_DESCRIPTOR_RANK (a) == 1) + { + retarray->dim[0].lbound = 0; + retarray->dim[0].ubound = b->dim[1].ubound - b->dim[1].lbound; + retarray->dim[0].stride = 1; + } + else if (GFC_DESCRIPTOR_RANK (b) == 1) + { + retarray->dim[0].lbound = 0; + retarray->dim[0].ubound = a->dim[0].ubound - a->dim[0].lbound; + retarray->dim[0].stride = 1; + } + else + { + retarray->dim[0].lbound = 0; + retarray->dim[0].ubound = a->dim[0].ubound - a->dim[0].lbound; + retarray->dim[0].stride = 1; + + retarray->dim[1].lbound = 0; + retarray->dim[1].ubound = b->dim[1].ubound - b->dim[1].lbound; + retarray->dim[1].stride = retarray->dim[0].ubound+1; + } + + retarray->data = internal_malloc (sizeof (GFC_INTEGER_8) * size0 (retarray)); + retarray->base = 0; + } + abase = a->data; bbase = b->data; dest = retarray->data; |