summaryrefslogtreecommitdiff
path: root/libgfortran/generated/reshape_r10.c
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-18 22:43:05 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-18 22:43:05 +0000
commitd0b5b6ea1ad7a0081f7b0e7f4bc284f49ee51238 (patch)
tree97cecaa39e4576d0bc34005844bc138cb8810cbc /libgfortran/generated/reshape_r10.c
parentda982362f10f6955efd57fa4d59a399a18f9d226 (diff)
downloadgcc-d0b5b6ea1ad7a0081f7b0e7f4bc284f49ee51238.tar.gz
2008-11-18 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/38135 * m4/reshape.m4: Correct bounds checking when PAD is present. Treat PAD as if it were SOURCE when SOURCE is empty. * intrinsics/reshape_generic.c: Likewise. * generated/reshape_c10.c Regenerated. * generated/reshape_c16.c Regenerated. * generated/reshape_c4.c Regenerated. * generated/reshape_c8.c Regenerated. * generated/reshape_i16.c Regenerated. * generated/reshape_i4.c Regenerated. * generated/reshape_i8.c Regenerated. * generated/reshape_r10.c Regenerated. * generated/reshape_r16.c Regenerated. * generated/reshape_r4.c Regenerated. * generated/reshape_r8.c Regenerated. 2008-11-18 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/38135 * gfortran.dg/reshape_pad_1.f90: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141982 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/generated/reshape_r10.c')
-rw-r--r--libgfortran/generated/reshape_r10.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libgfortran/generated/reshape_r10.c b/libgfortran/generated/reshape_r10.c
index 846d12f1f08..100173f70d0 100644
--- a/libgfortran/generated/reshape_r10.c
+++ b/libgfortran/generated/reshape_r10.c
@@ -137,7 +137,7 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
source_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
- if (rs != source_extent)
+ if (rs < source_extent || (rs > source_extent && !pad))
runtime_error("Incorrect size in SOURCE argument to RESHAPE"
" intrinsic: is %ld, should be %ld",
(long int) source_extent, (long int) rs);
@@ -262,16 +262,16 @@ reshape_r10 (gfc_array_r10 * const restrict ret,
if (sempty)
{
- /* Switch immediately to the pad array. */
+ /* Pretend we are using the pad array the first time around, too. */
src = pptr;
- sptr = NULL;
+ sptr = pptr;
sdim = pdim;
for (dim = 0; dim < pdim; dim++)
{
scount[dim] = pcount[dim];
sextent[dim] = pextent[dim];
sstride[dim] = pstride[dim];
- sstride0 = sstride[0] * sizeof (GFC_REAL_10);
+ sstride0 = pstride[0];
}
}