X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=libgfortran%2Fgenerated%2Freshape_i16.c;h=2888511556974ca3214c206023c510715bee6006;hp=a626465136550fb2927370b05a8061d840d7f97d;hb=d0b5b6ea1ad7a0081f7b0e7f4bc284f49ee51238;hpb=da982362f10f6955efd57fa4d59a399a18f9d226 diff --git a/libgfortran/generated/reshape_i16.c b/libgfortran/generated/reshape_i16.c index a6264651365..28885115569 100644 --- a/libgfortran/generated/reshape_i16.c +++ b/libgfortran/generated/reshape_i16.c @@ -137,7 +137,7 @@ reshape_16 (gfc_array_i16 * 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_16 (gfc_array_i16 * 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_INTEGER_16); + sstride0 = pstride[0]; } }