summaryrefslogtreecommitdiffstats
path: root/libgfortran/generated/reshape_r8.c
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-22 21:41:27 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-22 21:41:27 +0000
commitaeef03892d6f2b83ba14d8afdb990a52c9d73438 (patch)
tree6eef96808a54ab0bd4ddf78411a3d8f3000cd141 /libgfortran/generated/reshape_r8.c
parent209d3778a7ecf0614943c5be9263d89dfb76e80c (diff)
downloadppe42-gcc-aeef03892d6f2b83ba14d8afdb990a52c9d73438.tar.gz
ppe42-gcc-aeef03892d6f2b83ba14d8afdb990a52c9d73438.zip
2008-11-22 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/38225 * intrinsics/reshape_generic.c (reshape_internal): Use all dimensions of source for bounds checking. * m4/reshape.m4: 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-22 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/38225 * gfortran.dg/reshape_3.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142125 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/generated/reshape_r8.c')
-rw-r--r--libgfortran/generated/reshape_r8.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libgfortran/generated/reshape_r8.c b/libgfortran/generated/reshape_r8.c
index d8855e7874e..bacaaac05bc 100644
--- a/libgfortran/generated/reshape_r8.c
+++ b/libgfortran/generated/reshape_r8.c
@@ -135,7 +135,14 @@ reshape_r8 (gfc_array_r8 * const restrict ret,
(long int) ret_extent, (long int) shape_data[n]);
}
- source_extent = source->dim[0].ubound + 1 - source->dim[0].lbound;
+ source_extent = 1;
+ sdim = GFC_DESCRIPTOR_RANK (source);
+ for (n = 0; n < sdim; n++)
+ {
+ index_type se;
+ se = source->dim[n].ubound + 1 - source->dim[0].lbound;
+ source_extent *= se > 0 ? se : 0;
+ }
if (rs < source_extent || (rs > source_extent && !pad))
runtime_error("Incorrect size in SOURCE argument to RESHAPE"
OpenPOWER on IntegriCloud