]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/matmulavx128_c8.c
re PR fortran/86704 (Segmentation fault when using matmul in combination with transpose)
[thirdparty/gcc.git] / libgfortran / generated / matmulavx128_c8.c
index d440784c285c24bea81cfbb4b917b15346671fb5..accc69c4d1a20556569fc2bb00ec28f9a96a61e8 100644 (file)
@@ -282,8 +282,13 @@ matmul_c8_avx128_fma3 (gfc_array_c8 * const restrict retarray,
        return;
 
       /* Adjust size of t1 to what is needed.  */
-      index_type t1_dim;
-      t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1;
+      index_type t1_dim, a_sz;
+      if (aystride == 1)
+        a_sz = rystride;
+      else
+        a_sz = a_dim1;
+
+      t1_dim = a_sz * 256 + b_dim1;
       if (t1_dim > 65536)
        t1_dim = 65536;
 
@@ -835,8 +840,13 @@ matmul_c8_avx128_fma4 (gfc_array_c8 * const restrict retarray,
        return;
 
       /* Adjust size of t1 to what is needed.  */
-      index_type t1_dim;
-      t1_dim = (a_dim1 - (ycount > 1)) * 256 + b_dim1;
+      index_type t1_dim, a_sz;
+      if (aystride == 1)
+        a_sz = rystride;
+      else
+        a_sz = a_dim1;
+
+      t1_dim = a_sz * 256 + b_dim1;
       if (t1_dim > 65536)
        t1_dim = 65536;