aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_2.f9021
-rw-r--r--libgfortran/ChangeLog18
-rw-r--r--libgfortran/generated/matmul_c10.c4
-rw-r--r--libgfortran/generated/matmul_c16.c4
-rw-r--r--libgfortran/generated/matmul_c4.c4
-rw-r--r--libgfortran/generated/matmul_c8.c4
-rw-r--r--libgfortran/generated/matmul_i16.c4
-rw-r--r--libgfortran/generated/matmul_i4.c4
-rw-r--r--libgfortran/generated/matmul_i8.c4
-rw-r--r--libgfortran/generated/matmul_r10.c4
-rw-r--r--libgfortran/generated/matmul_r16.c4
-rw-r--r--libgfortran/generated/matmul_r4.c4
-rw-r--r--libgfortran/generated/matmul_r8.c4
-rw-r--r--libgfortran/m4/matmul.m44
15 files changed, 67 insertions, 25 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c3cccc5..277f767 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/gfortran.dg/matmul_2.f90 b/gcc/testsuite/gfortran.dg/matmul_2.f90
new file mode 100644
index 0000000..fb678af
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/matmul_2.f90
@@ -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
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 9053715..cb8c0fd 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -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>
diff --git a/libgfortran/generated/matmul_c10.c b/libgfortran/generated/matmul_c10.c
index edbd1e6..93032f8 100644
--- a/libgfortran/generated/matmul_c10.c
+++ b/libgfortran/generated/matmul_c10.c
@@ -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++)
diff --git a/libgfortran/generated/matmul_c16.c b/libgfortran/generated/matmul_c16.c
index c04146b..03ad0f7 100644
--- a/libgfortran/generated/matmul_c16.c
+++ b/libgfortran/generated/matmul_c16.c
@@ -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++)
diff --git a/libgfortran/generated/matmul_c4.c b/libgfortran/generated/matmul_c4.c
index a01de37..84c94cd 100644
--- a/libgfortran/generated/matmul_c4.c
+++ b/libgfortran/generated/matmul_c4.c
@@ -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++)
diff --git a/libgfortran/generated/matmul_c8.c b/libgfortran/generated/matmul_c8.c
index 75ec4fc..f491ea0 100644
--- a/libgfortran/generated/matmul_c8.c
+++ b/libgfortran/generated/matmul_c8.c
@@ -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++)
diff --git a/libgfortran/generated/matmul_i16.c b/libgfortran/generated/matmul_i16.c
index eacc47f..50d87bb 100644
--- a/libgfortran/generated/matmul_i16.c
+++ b/libgfortran/generated/matmul_i16.c
@@ -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++)
diff --git a/libgfortran/generated/matmul_i4.c b/libgfortran/generated/matmul_i4.c
index 6166bf1..12ac630 100644
--- a/libgfortran/generated/matmul_i4.c
+++ b/libgfortran/generated/matmul_i4.c
@@ -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++)
diff --git a/libgfortran/generated/matmul_i8.c b/libgfortran/generated/matmul_i8.c
index b83ded0..82b2229 100644
--- a/libgfortran/generated/matmul_i8.c
+++ b/libgfortran/generated/matmul_i8.c
@@ -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++)
diff --git a/libgfortran/generated/matmul_r10.c b/libgfortran/generated/matmul_r10.c
index 6702209..73e1e327 100644
--- a/libgfortran/generated/matmul_r10.c
+++ b/libgfortran/generated/matmul_r10.c
@@ -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++)
diff --git a/libgfortran/generated/matmul_r16.c b/libgfortran/generated/matmul_r16.c
index c095cbd..099c6bf 100644
--- a/libgfortran/generated/matmul_r16.c
+++ b/libgfortran/generated/matmul_r16.c
@@ -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++)
diff --git a/libgfortran/generated/matmul_r4.c b/libgfortran/generated/matmul_r4.c
index dedc5a3..ca6a4a4 100644
--- a/libgfortran/generated/matmul_r4.c
+++ b/libgfortran/generated/matmul_r4.c
@@ -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++)
diff --git a/libgfortran/generated/matmul_r8.c b/libgfortran/generated/matmul_r8.c
index 926a860..1844cdc 100644
--- a/libgfortran/generated/matmul_r8.c
+++ b/libgfortran/generated/matmul_r8.c
@@ -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++)
diff --git a/libgfortran/m4/matmul.m4 b/libgfortran/m4/matmul.m4
index f488f5e..526303c 100644
--- a/libgfortran/m4/matmul.m4
+++ b/libgfortran/m4/matmul.m4
@@ -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++)