https://gcc.gnu.org/g:8094a5714f0c6ecf371a73427b57e26537b711d5

commit 8094a5714f0c6ecf371a73427b57e26537b711d5
Author: Mikael Morin <[email protected]>
Date:   Tue Sep 9 16:20:10 2025 +0200

    Correction matmul.m4

Diff:
---
 libgfortran/m4/matmul_internal.m4 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libgfortran/m4/matmul_internal.m4 
b/libgfortran/m4/matmul_internal.m4
index b5fe0c1213f3..870b392e77d6 100644
--- a/libgfortran/m4/matmul_internal.m4
+++ b/libgfortran/m4/matmul_internal.m4
@@ -9,7 +9,7 @@
 
   index_type rxstride, rystride, axstride, aystride, bxstride, bystride;
   index_type x, y, n, count, xcount, ycount;
-  index_type aystride_bytes, bystride_bytes;
+  index_type aystride_bytes, bystride_bytes, rystride_bytes;
 
   assert (GFC_DESCRIPTOR_RANK (a) == 2
           || GFC_DESCRIPTOR_RANK (b) == 2);
@@ -99,11 +99,13 @@ sinclude(`matmul_asm_'rtype_code`.m4')dnl
         either as a row or a column matrix. We want both cases to
         work. */
       rxstride = rystride = GFC_DESCRIPTOR_STRIDE(retarray,0);
+      rystride_bytes = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,0);
     }
   else
     {
       rxstride = GFC_DESCRIPTOR_STRIDE(retarray,0);
       rystride = GFC_DESCRIPTOR_STRIDE(retarray,1);
+      rystride_bytes = GFC_DESCRIPTOR_STRIDE_BYTES(retarray,1);
     }
 
   if (GFC_DESCRIPTOR_RANK (a) == 1)
@@ -229,7 +231,7 @@ sinclude(`matmul_asm_'rtype_code`.m4')dnl
 
       /* Parameter adjustments */
       c_dim1 = rystride;
-      PTR_DECREMENT_BYTES (c, sizeof('rtype_name`) + 
GFC_DESCRIPTOR_STRIDE_BYTES(retarray,1));
+      PTR_DECREMENT_BYTES (c, sizeof('rtype_name`) + rystride_bytes);
       a_dim1 = aystride;
       PTR_DECREMENT_BYTES (a, sizeof('rtype_name`) + aystride_bytes);
       b_dim1 = bystride;

Reply via email to