public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Koenig <tkoenig@netcologne.de>
To: fortran@gcc.gnu.org, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [patch, fortran] Fix PR 69154, inline matmul with WHERE
Date: Sun, 10 Jan 2016 12:38:00 -0000	[thread overview]
Message-ID: <569250CD.4020102@netcologne.de> (raw)
In-Reply-To: <5692469F.8090906@netcologne.de>

[-- Attachment #1: Type: text/plain, Size: 373 bytes --]

Am 10.01.2016 um 12:55 schrieb Thomas Koenig:
> Hello world,
>
> the attached patch fixes the regression.  Before this, front-end
> optimization would have tried to put a DO loop inside a WHERE construct,
> leading to an ICE.

The updated test case demonstrates that matmul inlining is done even
after not doing it inside a WHERE.

OK for trunk with that change?

	Thomas


[-- Attachment #2: inline_matmul_12.f90 --]
[-- Type: text/x-fortran, Size: 717 bytes --]

! { dg-do compile }
! { dg-options "-ffrontend-optimize -fdump-tree-original" }
! PR 69154 - inlined matmul used to cause an ICE inside a WHERE.
MODULE m_numeric_tools
 INTEGER, PARAMETER :: dp=8
CONTAINS
subroutine llsfit_svd(xx,yy,sigma,nfuncs,funcs,chisq,par,var,cov,info)
 real(dp),intent(in) :: xx(:),yy(:),sigma(:)
 real(dp),dimension(SIZE(xx)) :: bb,sigm1
 real(dp) :: tmp(nfuncs)
 real(dp),allocatable :: work(:),Vt(:,:),U(:,:),S(:)
 real(dp),dimension(3,3) :: a, b, c
 WHERE (S>TOL_*MAXVAL(S))
  tmp=MATMUL(bb,U)/S
 END WHERE
 call random_number(a)
 call random_number(b)
 c = matmul(a,b)
end subroutine llsfit_svd

END MODULE m_numeric_tools
! { dg-final { scan-tree-dump-times "matmul_r8" 1 "original" } }

  reply	other threads:[~2016-01-10 12:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-10 11:55 Thomas Koenig
2016-01-10 12:38 ` Thomas Koenig [this message]
2016-01-11 21:58 ` Toon Moene
2016-01-11 22:25   ` Steve Kargl
2016-01-11 23:02   ` Thomas Koenig
2016-01-11 23:17     ` Toon Moene
2016-01-12  7:33       ` Thomas Koenig
2016-01-12 18:37         ` Toon Moene
2016-01-10 12:49 Paul Richard Thomas

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=569250CD.4020102@netcologne.de \
    --to=tkoenig@netcologne.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).