re PR libfortran/26985 (incorrect matmul result)

PR libfortran/26985

	* m4/matmul.m4: Correct the condition for the memset call,
	and remove the unneeded call to size0.
	* generated/matmul_r4.c: Regenerate.
	* generated/matmul_r8.c: Regenerate.
	* generated/matmul_r10.c: Regenerate.
	* generated/matmul_r16.c: Regenerate.
	* generated/matmul_c4.c: Regenerate.
	* generated/matmul_c8.c: Regenerate.
	* generated/matmul_c10.c: Regenerate.
	* generated/matmul_c16.c: Regenerate.
	* generated/matmul_i4.c: Regenerate.
	* generated/matmul_i8.c: Regenerate.
	* generated/matmul_i16.c: Regenerate.

	* gfortran.dg/matmul_2.f90: New test.

From-SVN: r113552
This commit is contained in:
Francois-Xavier Coudert 2006-05-05 13:08:23 +02:00 committed by François-Xavier Coudert
parent 4b5d3f3f41
commit 1633cb7cb6
15 changed files with 67 additions and 25 deletions

View File

@ -1,3 +1,8 @@
2006-05-05 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/26985
* gfortran.dg/matmul_2.f90: New test.
2005-05-05 Laurent GUERBY <laurent@guerby.net>
* ada/acats/run_all.sh: Use sync when main not found.

View File

@ -0,0 +1,21 @@
!{ dg-do run }
! PR libfortran/26985
program matmul_2
implicit none
integer :: a(2,9), b(9,7), c(2,7)
integer :: i, j
a = 1
b = 2
c = 1789789
c(:,1:7:2) = matmul(a,b(:,1:7:2))
if (c(1,1) /= 18 .or. c(2,1) /= 18 .or. &
c(1,2) /= 1789789 .or. c(2,2) /= 1789789 .or. &
c(1,3) /= 18 .or. c(2,3) /= 18 .or. &
c(1,4) /= 1789789 .or. c(2,4) /= 1789789 .or. &
c(1,5) /= 18 .or. c(2,5) /= 18 .or. &
c(1,6) /= 1789789 .or. c(2,6) /= 1789789 .or. &
c(1,7) /= 18 .or. c(2,7) /= 18) call abort
end program matmul_2

View File

@ -1,7 +1,23 @@
2006-05-05 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/26985
* m4/matmul.m4: Correct the condition for the memset call,
and remove the unneeded call to size0.
* generated/matmul_r4.c: Regenerate.
* generated/matmul_r8.c: Regenerate.
* generated/matmul_r10.c: Regenerate.
* generated/matmul_r16.c: Regenerate.
* generated/matmul_c4.c: Regenerate.
* generated/matmul_c8.c: Regenerate.
* generated/matmul_c10.c: Regenerate.
* generated/matmul_c16.c: Regenerate.
* generated/matmul_i4.c: Regenerate.
* generated/matmul_i8.c: Regenerate.
* generated/matmul_i16.c: Regenerate.
2006-04-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/27360
* io/list_read.c (read_logical): Free line_buffer and free saved.
2006-04-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>

View File

@ -193,8 +193,8 @@ matmul_c10 (gfc_array_c10 * const restrict retarray,
const GFC_COMPLEX_10 * restrict abase_n;
GFC_COMPLEX_10 bbase_yn;
if (rystride == ycount)
memset (dest, 0, (sizeof (GFC_COMPLEX_10) * size0((array_t *) retarray)));
if (rystride == xcount)
memset (dest, 0, (sizeof (GFC_COMPLEX_10) * xcount * ycount));
else
{
for (y = 0; y < ycount; y++)

View File

@ -193,8 +193,8 @@ matmul_c16 (gfc_array_c16 * const restrict retarray,
const GFC_COMPLEX_16 * restrict abase_n;
GFC_COMPLEX_16 bbase_yn;
if (rystride == ycount)
memset (dest, 0, (sizeof (GFC_COMPLEX_16) * size0((array_t *) retarray)));
if (rystride == xcount)
memset (dest, 0, (sizeof (GFC_COMPLEX_16) * xcount * ycount));
else
{
for (y = 0; y < ycount; y++)

View File

@ -193,8 +193,8 @@ matmul_c4 (gfc_array_c4 * const restrict retarray,
const GFC_COMPLEX_4 * restrict abase_n;
GFC_COMPLEX_4 bbase_yn;
if (rystride == ycount)
memset (dest, 0, (sizeof (GFC_COMPLEX_4) * size0((array_t *) retarray)));
if (rystride == xcount)
memset (dest, 0, (sizeof (GFC_COMPLEX_4) * xcount * ycount));
else
{
for (y = 0; y < ycount; y++)

View File

@ -193,8 +193,8 @@ matmul_c8 (gfc_array_c8 * const restrict retarray,
const GFC_COMPLEX_8 * restrict abase_n;
GFC_COMPLEX_8 bbase_yn;
if (rystride == ycount)
memset (dest, 0, (sizeof (GFC_COMPLEX_8) * size0((array_t *) retarray)));
if (rystride == xcount)
memset (dest, 0, (sizeof (GFC_COMPLEX_8) * xcount * ycount));
else
{
for (y = 0; y < ycount; y++)

View File

@ -193,8 +193,8 @@ matmul_i16 (gfc_array_i16 * const restrict retarray,
const GFC_INTEGER_16 * restrict abase_n;
GFC_INTEGER_16 bbase_yn;
if (rystride == ycount)
memset (dest, 0, (sizeof (GFC_INTEGER_16) * size0((array_t *) retarray)));
if (rystride == xcount)
memset (dest, 0, (sizeof (GFC_INTEGER_16) * xcount * ycount));
else
{
for (y = 0; y < ycount; y++)

View File

@ -193,8 +193,8 @@ matmul_i4 (gfc_array_i4 * const restrict retarray,
const GFC_INTEGER_4 * restrict abase_n;
GFC_INTEGER_4 bbase_yn;
if (rystride == ycount)
memset (dest, 0, (sizeof (GFC_INTEGER_4) * size0((array_t *) retarray)));
if (rystride == xcount)
memset (dest, 0, (sizeof (GFC_INTEGER_4) * xcount * ycount));
else
{
for (y = 0; y < ycount; y++)

View File

@ -193,8 +193,8 @@ matmul_i8 (gfc_array_i8 * const restrict retarray,
const GFC_INTEGER_8 * restrict abase_n;
GFC_INTEGER_8 bbase_yn;
if (rystride == ycount)
memset (dest, 0, (sizeof (GFC_INTEGER_8) * size0((array_t *) retarray)));
if (rystride == xcount)
memset (dest, 0, (sizeof (GFC_INTEGER_8) * xcount * ycount));
else
{
for (y = 0; y < ycount; y++)

View File

@ -193,8 +193,8 @@ matmul_r10 (gfc_array_r10 * const restrict retarray,
const GFC_REAL_10 * restrict abase_n;
GFC_REAL_10 bbase_yn;
if (rystride == ycount)
memset (dest, 0, (sizeof (GFC_REAL_10) * size0((array_t *) retarray)));
if (rystride == xcount)
memset (dest, 0, (sizeof (GFC_REAL_10) * xcount * ycount));
else
{
for (y = 0; y < ycount; y++)

View File

@ -193,8 +193,8 @@ matmul_r16 (gfc_array_r16 * const restrict retarray,
const GFC_REAL_16 * restrict abase_n;
GFC_REAL_16 bbase_yn;
if (rystride == ycount)
memset (dest, 0, (sizeof (GFC_REAL_16) * size0((array_t *) retarray)));
if (rystride == xcount)
memset (dest, 0, (sizeof (GFC_REAL_16) * xcount * ycount));
else
{
for (y = 0; y < ycount; y++)

View File

@ -193,8 +193,8 @@ matmul_r4 (gfc_array_r4 * const restrict retarray,
const GFC_REAL_4 * restrict abase_n;
GFC_REAL_4 bbase_yn;
if (rystride == ycount)
memset (dest, 0, (sizeof (GFC_REAL_4) * size0((array_t *) retarray)));
if (rystride == xcount)
memset (dest, 0, (sizeof (GFC_REAL_4) * xcount * ycount));
else
{
for (y = 0; y < ycount; y++)

View File

@ -193,8 +193,8 @@ matmul_r8 (gfc_array_r8 * const restrict retarray,
const GFC_REAL_8 * restrict abase_n;
GFC_REAL_8 bbase_yn;
if (rystride == ycount)
memset (dest, 0, (sizeof (GFC_REAL_8) * size0((array_t *) retarray)));
if (rystride == xcount)
memset (dest, 0, (sizeof (GFC_REAL_8) * xcount * ycount));
else
{
for (y = 0; y < ycount; y++)

View File

@ -195,8 +195,8 @@ sinclude(`matmul_asm_'rtype_code`.m4')dnl
const rtype_name * restrict abase_n;
rtype_name bbase_yn;
if (rystride == ycount)
memset (dest, 0, (sizeof (rtype_name) * size0((array_t *) retarray)));
if (rystride == xcount)
memset (dest, 0, (sizeof (rtype_name) * xcount * ycount));
else
{
for (y = 0; y < ycount; y++)