https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80602
--- Comment #1 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
This is the idea:
--- matmul_internal.m4 (revision 247566)
+++ matmul_internal.m4 (working copy)
@@ -202,7 +202,7 @@ sinclude(`matmul_asm_'rtype_code`.m4')dnl
i1, i2, i3, i4, i5, i6;
/* Local variables */
- 'rtype_name` t1[65536], /* was [256][256] */
+ 'rtype_name`
f11, f12, f21, f22, f31, f32, f41, f42,
f13, f14, f23, f24, f33, f34, f43, f44;
index_type i, j, l, ii, jj, ll;
@@ -227,6 +227,14 @@ sinclude(`matmul_asm_'rtype_code`.m4')dnl
if (m == 0 || n == 0 || k == 0)
return;
+ /* Adjust size of t1 to what is needed. */
+ index_type t1_dim;
+ t1_dim = (a_dim1-1) * 256 + b_dim1);
+ if (t1_dim > 65536)
+ t1_dim = 65536;
+
+ 'rtype_name` t1[t1_dim], /* was [256][256] */
+
/* Empty c first. */
for (j=1; j<=n; j++)
for (i=1; i<=m; i++)