[Bug libfortran/85253] [8 Regression] asan detects heap-buffer-overflow in matmul_r4.c
tkoenig at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Apr 6 15:04:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85253
--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Yep, looking at the code, it seems that in this special
case, we need one more row in the temporary buffer.
This seems to cure it.
Index: m4/matmul_internal.m4
===================================================================
--- m4/matmul_internal.m4 (Revision 259152)
+++ m4/matmul_internal.m4 (Arbeitskopie)
@@ -234,7 +234,7 @@ sinclude(`matmul_asm_'rtype_code`.m4')dnl
/* Adjust size of t1 to what is needed. */
index_type t1_dim;
- t1_dim = (a_dim1-1) * 256 + b_dim1;
+ t1_dim = (a_dim1- (ycount > 1)) * 256 + b_dim1;
if (t1_dim > 65536)
t1_dim = 65536;
More information about the Gcc-bugs
mailing list