public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jerry DeLisle <jvdelisle@charter.net>
To: Harald Anlauf <anlauf@gmx.de>, fortran <fortran@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR libfortran/99218 - [8/9/10/11 Regression] matmul on temporary array accesses invalid memory
Date: Wed, 3 Mar 2021 18:16:04 -0800	[thread overview]
Message-ID: <12e03f3f-9700-f091-712e-5791a93db40e@charter.net> (raw)
In-Reply-To: <trinity-531ae230-c976-4e80-985d-9fd3864efe56-1614116782427@3c-app-gmx-bs42>

Yes, OK, however, have you been able to test performance. I am only 
curious. There was a test program we used back when this code was first 
implemented in bugzilla. I do not remember the PR number off hand.

Jerry

On 2/23/21 1:46 PM, Harald Anlauf via Fortran wrote:
> Dear all,
>
> under certain circumstances a call to MATMUL for rank-2 times rank-1
> would invoke a highly tuned rank-2 times rank-2 algorithm which could
> lead to invalid reads and writes.  The solution is to check the rank
> of the second argument to matmul and fall back to a regular algorithm
> for rank-1.  The invalid accesses did show up with valgrind.
>
> I have not been able to create a testcase that gives wrong results.
>
> Regtested on x86_64-pc-linux-gnu, and verified with valgrind.
>
> OK for master?
>
> As this affects all open branches down to 8, ok for backports?
>
> Thanks,
> Harald
>
>
> PR libfortran/99218 - matmul on temporary array accesses invalid memory
>
> Do not invoke tuned rank-2 times rank-2 matmul if rank(b) == 1.
>
> libgfortran/ChangeLog:
>
> 	PR libfortran/99218
> 	* m4/matmul_internal.m4: Invoke tuned matmul only for rank(b)>1.
> 	* generated/matmul_c10.c: Regenerated.
>          * generated/matmul_c16.c: Likewise.
>          * generated/matmul_c4.c: Likewise.
>          * generated/matmul_c8.c: Likewise.
>          * generated/matmul_i1.c: Likewise.
>          * generated/matmul_i16.c: Likewise.
>          * generated/matmul_i2.c: Likewise.
>          * generated/matmul_i4.c: Likewise.
>          * generated/matmul_i8.c: Likewise.
>          * generated/matmul_r10.c: Likewise.
>          * generated/matmul_r16.c: Likewise.
>          * generated/matmul_r4.c: Likewise.
>          * generated/matmul_r8.c: Likewise.
>          * generated/matmulavx128_c10.c: Likewise.
>          * generated/matmulavx128_c16.c: Likewise.
>          * generated/matmulavx128_c4.c: Likewise.
>          * generated/matmulavx128_c8.c: Likewise.
>          * generated/matmulavx128_i1.c: Likewise.
>          * generated/matmulavx128_i16.c: Likewise.
>          * generated/matmulavx128_i2.c: Likewise.
>          * generated/matmulavx128_i4.c: Likewise.
>          * generated/matmulavx128_i8.c: Likewise.
>          * generated/matmulavx128_r10.c: Likewise.
>          * generated/matmulavx128_r16.c: Likewise.
>          * generated/matmulavx128_r4.c: Likewise.
>          * generated/matmulavx128_r8.c: Likewise.
>


  parent reply	other threads:[~2021-03-04  2:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23 21:46 Harald Anlauf
2021-03-01 22:19 ` *PING* " Harald Anlauf
2021-03-04  2:16 ` Jerry DeLisle [this message]
2021-03-04 20:23   ` Aw: " Harald Anlauf
2021-03-05 19:56     ` Harald Anlauf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=12e03f3f-9700-f091-712e-5791a93db40e@charter.net \
    --to=jvdelisle@charter.net \
    --cc=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).