This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, fortran] Reduce stack use in blocked matmul


On Mai 05 2017, Thomas Koenig <tkoenig@netcologne.de> wrote:

> @@ -227,6 +226,17 @@ 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;
> +
> +#pragma GCC diagnostic push
> +#pragma GCC diagnostic ignored "-Wvla"
> +      'rtype_name` t1[t1_dim]; /* was [256][256] */

That does the wrong thing if b_dim1 == 0xDEADBEEF.

(gdb) p (a_dim1-1) * 256 + b_dim1
$2 = -764456190

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]