public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Koenig <tkoenig@netcologne.de>
To: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [fortran, RFC] Getting rid of unneeded functions in libgfortran
Date: Mon, 10 Jul 2017 18:44:00 -0000	[thread overview]
Message-ID: <8d590b03-2b7d-d9db-b8be-f812129586c7@netcologne.de> (raw)

Hello world,

with the bump in the libfortran version that is needed with
Paul's patch, I think we can get rid of a few functions
that we do not actually need any more.

I think we now always inline SUM and PRODUCT. We don't do so with all
occurrences of ANY and ALL, but we probably could (and should).

So, is it a worthy goal to eliminate all occurences of these
functions from libgfortran before 8.1 comes out?

Regards

	Thomas

BTW, here are test cases for SUM and PRODUCT:

ig25@linux-d6cw:~/Krempel/Sum> cat pr.f90
program main
   real, dimension(10,10,10) :: a
   real, dimension(10,10) :: b
   real :: s
   call random_number(a)
   s = product(a)
   print *,s
   s = product(a,a>0.3)
   print *,s
   b = product(a,dim=2,mask=a>0.3)
   print *,b
   print *,product(a)
   print *,product(a,a>3)
   print *,product(a,dim=2,mask=a>0.3)
end program main
ig25@linux-d6cw:~/Krempel/Sum> gfortran -fdump-tree-original pr.f90 && 
grep -i product pr.f90.003t.original
ig25@linux-d6cw:~/Krempel/Sum> cat su.f90
program main
   real, dimension(10,10,10) :: a
   real, dimension(10,10) :: b
   real :: s
   call random_number(a)
   s = sum(a)
   print *,s
   s = sum(a,a>0.3)
   print *,s
   b = sum(a,dim=2,mask=a>0.3)
   print *,b
   print *,sum(a)
   print *,sum(a,a>3)
   print *,sum(a,dim=2,mask=a>0.3)
end program main
ig25@linux-d6cw:~/Krempel/Sum> gfortran -fdump-tree-original su.f90 && 
grep -i sum su.f90.003t.original
ig25@linux-d6cw:~/Krempel/Sum>

             reply	other threads:[~2017-07-10 18:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10 18:44 Thomas Koenig [this message]
2017-07-10 21:28 ` Mikael Morin
2017-07-10 22:15   ` Thomas Koenig
2017-07-10 21:30 ` Ulrich Drepper

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=8d590b03-2b7d-d9db-b8be-f812129586c7@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).