diff options
author | tkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-10-21 20:12:52 +0000 |
---|---|---|
committer | tkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-10-21 20:12:52 +0000 |
commit | 3fc453f14bc190b1cfac477f6fdc95edfa7dbf12 (patch) | |
tree | 4f368862290e2b5e79a8d920c685df20c5d2c9de /libgfortran/generated/transpose_r8.c | |
parent | 7acb838bb364d99cd6adf705db3c421d2d4d338a (diff) | |
download | gcc-3fc453f14bc190b1cfac477f6fdc95edfa7dbf12.tar.gz |
2008-10-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/34670
* intrinsics/transpose_generic.c: Implement bounds checking.
* m4/transpose.m4: Likewise.
* generated/transpose_c8.c: Regenerated.
* generated/transpose_c16.c: Regenerated.
* generated/transpose_r10.c: Regenerated.
* generated/transpose_i8.c: Regenerated.
* generated/transpose_c10.c: Regenerated.
* generated/transpose_r4.c: Regenerated.
* generated/transpose_c4.c: Regenerated.
* generated/transpose_i16.c: Regenerated.
* generated/transpose_i4.c: Regenerated.
* generated/transpose_r8.c: Regenerated.
* generated/transpose_r16.c: Regenerated.
2008-10-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/34670
* gfortran.dg/transpose_2.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141276 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/generated/transpose_r8.c')
-rw-r--r-- | libgfortran/generated/transpose_r8.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libgfortran/generated/transpose_r8.c b/libgfortran/generated/transpose_r8.c index bbd87649126..78ae4a1a95a 100644 --- a/libgfortran/generated/transpose_r8.c +++ b/libgfortran/generated/transpose_r8.c @@ -69,6 +69,28 @@ transpose_r8 (gfc_array_r8 * const restrict ret, ret->data = internal_malloc_size (sizeof (GFC_REAL_8) * size0 ((array_t *) ret)); ret->offset = 0; + } else if (unlikely (compile_options.bounds_check)) + { + index_type ret_extent, src_extent; + + ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound; + src_extent = source->dim[1].ubound + 1 - source->dim[1].lbound; + + if (src_extent != ret_extent) + runtime_error ("Incorrect extent in return value of TRANSPOSE" + " intrinsic in dimension 1: is %ld," + " should be %ld", (long int) src_extent, + (long int) ret_extent); + + ret_extent = ret->dim[1].ubound + 1 - ret->dim[1].lbound; + src_extent = source->dim[0].ubound + 1 - source->dim[0].lbound; + + if (src_extent != ret_extent) + runtime_error ("Incorrect extent in return value of TRANSPOSE" + " intrinsic in dimension 2: is %ld," + " should be %ld", (long int) src_extent, + (long int) ret_extent); + } sxstride = source->dim[0].stride; |