This is the mail archive of the
mailing list for the GCC project.
Re: [patch, fortran, 4.9] Improve efficiency of array constructor operators
- From: Tobias Burnus <burnus at net-b dot de>
- To: Thomas Koenig <tkoenig at netcologne dot de>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 26 Mar 2013 16:35:00 +0100
- Subject: Re: [patch, fortran, 4.9] Improve efficiency of array constructor operators
- References: <51458DD6 dot 8000200 at netcologne dot de>
Thomas Koenig wrote:
this patch finally makes the idiom
if (any([a,b,c] < eps)) then
if (a<eps .or. b<eps .or. c<eps) then
so that there is no loss in efficiency through generating
I have not yet looked at the patch, but I wonder whether that causes
invalid code for
if (any([a,b,c] < f()))
by evaluating f() multiple times.
Another question is: Why do we generate a temporary array for ANY/ALL? A
scalar should be sufficient, i.e.
res = .false.
do i = 1, n
res = res .or. (array(i) < eps)
In the scalar case with known array size, the middle-end should also be
able to fully unroll the loop.
I do not really see in how far such a patch would replace your patch -
or whether it should be done additionally.