X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=libgfortran%2Fgenerated%2Freshape_r8.c;h=d8855e7874e60257cc93acca1a619b8262a4bf50;hb=d0b5b6ea1ad7a0081f7b0e7f4bc284f49ee51238;hp=9da26d4c199413ec3ed27af5807cb65823f7f7ca;hpb=da982362f10f6955efd57fa4d59a399a18f9d226;p=pf3gnuchains%2Fgcc-fork.git diff --git a/libgfortran/generated/reshape_r8.c b/libgfortran/generated/reshape_r8.c index 9da26d4c199..d8855e7874e 100644 --- a/libgfortran/generated/reshape_r8.c +++ b/libgfortran/generated/reshape_r8.c @@ -137,7 +137,7 @@ reshape_r8 (gfc_array_r8 * 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_r8 (gfc_array_r8 * 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_8); + sstride0 = pstride[0]; } }