re PR libfortran/32336 (matmul: flag runtime- instead of assertation error)

2007-07-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32336
	* m4/matmul.m4:  When the dimension of b is incorrect,
	raise a runtime error instead of a failed assertion.
	* generated/matmul_i1.c:  Regenerated.
	* generated/matmul_i2.c:  Regenerated.
	* generated/matmul_i4.c:  Regenerated.
	* generated/matmul_i8.c:  Regenerated.
	* generated/matmul_i16.c:  Regenerated.
	* generated/matmul_r4.c:  Regenerated.
	* generated/matmul_r8.c:  Regenerated.
	* generated/matmul_r10.c:  Regenerated.
	* generated/matmul_r16.c:  Regenerated.

2007-07-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/32336
	* gfortran.dg/matmul_5.f90:  New test case.

From-SVN: r126498
This commit is contained in:
Thomas Koenig 2007-07-09 22:34:43 +00:00
parent 924a20b64b
commit 18c492a994
17 changed files with 59 additions and 14 deletions

View File

@ -1,3 +1,8 @@
2007-07-09 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/32336
* gfortran.dg/matmul_5.f90: New test case.
2007-07-09 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/fesd-any.c: Move to gcc.dg/debug/dwarf2 directory.

View File

@ -0,0 +1,11 @@
! { dg-do run }
! { dg-shouldfail "dimension of array B incorrect in MATMUL intrinsic" }
program main
real, dimension(:,:), allocatable :: a
real, dimension(:), allocatable :: b
allocate (a(2,2), b(3))
call random_number(a)
call random_number(b)
print *,matmul(a,b)
end program main
! { dg-output "Fortran runtime error: dimension of array B incorrect in MATMUL intrinsic.*" }

View File

@ -1,3 +1,18 @@
2007-07-09 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/32336
* m4/matmul.m4: When the dimension of b is incorrect,
raise a runtime error instead of a failed assertion.
* generated/matmul_i1.c: Regenerated.
* generated/matmul_i2.c: Regenerated.
* generated/matmul_i4.c: Regenerated.
* generated/matmul_i8.c: Regenerated.
* generated/matmul_i16.c: Regenerated.
* generated/matmul_r4.c: Regenerated.
* generated/matmul_r8.c: Regenerated.
* generated/matmul_r10.c: Regenerated.
* generated/matmul_r16.c: Regenerated.
2007-07-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/32678

View File

@ -169,7 +169,8 @@ matmul_c10 (gfc_array_c10 * const restrict retarray,
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
if (GFC_DESCRIPTOR_RANK (b) == 1)
{

View File

@ -169,7 +169,8 @@ matmul_c16 (gfc_array_c16 * const restrict retarray,
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
if (GFC_DESCRIPTOR_RANK (b) == 1)
{

View File

@ -169,7 +169,8 @@ matmul_c4 (gfc_array_c4 * const restrict retarray,
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
if (GFC_DESCRIPTOR_RANK (b) == 1)
{

View File

@ -169,7 +169,8 @@ matmul_c8 (gfc_array_c8 * const restrict retarray,
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
if (GFC_DESCRIPTOR_RANK (b) == 1)
{

View File

@ -169,7 +169,8 @@ matmul_i1 (gfc_array_i1 * const restrict retarray,
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
if (GFC_DESCRIPTOR_RANK (b) == 1)
{

View File

@ -169,7 +169,8 @@ matmul_i16 (gfc_array_i16 * const restrict retarray,
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
if (GFC_DESCRIPTOR_RANK (b) == 1)
{

View File

@ -169,7 +169,8 @@ matmul_i2 (gfc_array_i2 * const restrict retarray,
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
if (GFC_DESCRIPTOR_RANK (b) == 1)
{

View File

@ -169,7 +169,8 @@ matmul_i4 (gfc_array_i4 * const restrict retarray,
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
if (GFC_DESCRIPTOR_RANK (b) == 1)
{

View File

@ -169,7 +169,8 @@ matmul_i8 (gfc_array_i8 * const restrict retarray,
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
if (GFC_DESCRIPTOR_RANK (b) == 1)
{

View File

@ -169,7 +169,8 @@ matmul_r10 (gfc_array_r10 * const restrict retarray,
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
if (GFC_DESCRIPTOR_RANK (b) == 1)
{

View File

@ -169,7 +169,8 @@ matmul_r16 (gfc_array_r16 * const restrict retarray,
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
if (GFC_DESCRIPTOR_RANK (b) == 1)
{

View File

@ -169,7 +169,8 @@ matmul_r4 (gfc_array_r4 * const restrict retarray,
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
if (GFC_DESCRIPTOR_RANK (b) == 1)
{

View File

@ -169,7 +169,8 @@ matmul_r8 (gfc_array_r8 * const restrict retarray,
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
if (GFC_DESCRIPTOR_RANK (b) == 1)
{

View File

@ -171,7 +171,8 @@ sinclude(`matmul_asm_'rtype_code`.m4')dnl
xcount = a->dim[0].ubound + 1 - a->dim[0].lbound;
}
assert(count == b->dim[0].ubound + 1 - b->dim[0].lbound);
if (count != b->dim[0].ubound + 1 - b->dim[0].lbound)
runtime_error ("dimension of array B incorrect in MATMUL intrinsic");
if (GFC_DESCRIPTOR_RANK (b) == 1)
{