/* Implementation of the SHAPE intrinsic
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2006, 2007 Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
This file is part of the GNU Fortran 95 runtime library (libgfortran).
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
-#include "config.h"
+#include "libgfortran.h"
#include <stdlib.h>
#include <assert.h>
-#include "libgfortran.h"
+
#if defined (HAVE_GFC_INTEGER_16)
-extern void shape_16 (gfc_array_i16 * ret, const gfc_array_i16 * array);
+extern void shape_16 (gfc_array_i16 * const restrict ret,
+ const gfc_array_i16 * const restrict array);
export_proto(shape_16);
void
-shape_16 (gfc_array_i16 * ret, const gfc_array_i16 * array)
+shape_16 (gfc_array_i16 * const restrict ret,
+ const gfc_array_i16 * const restrict array)
{
int n;
index_type stride;
stride = ret->dim[0].stride;
- if (stride == 0)
- stride = 1;
+
+ if (ret->dim[0].ubound < ret->dim[0].lbound)
+ return;
for (n = 0; n < GFC_DESCRIPTOR_RANK (array); n++)
{