This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran 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, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 28 Mar 2013 19:34:31 +0100
- Subject: Re: [patch, fortran, 4.9] Improve efficiency of array constructor operators
- References: <51458DD6 dot 8000200 at netcologne dot de> <514F743D dot 6020704 at netcologne dot de>
On 28.03.2013 17:11, Thomas Koenig wrote:
Am 26.03.2013 18:17, schrieb Thomas Koenig:
Hi Tobias,
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.
This is avoided by this part of the patch: [...] which results in
code like this:
__var_1 = f ();
if ((a > __var_1 || b > __var_1) || c > __var_1)
Are there any other concerns, or can I commit this?
Indeed, the code looks fine. OK for the trunk - see nits below. Thanks
for the patch!
On 24.03.2013 22:46, Thomas Koenig wrote:
+}
+
/* Recursive optimization of operators. */
Another empty line missing.
Tobias
PS: Regarding the string comparison patch: As Janne, think it should be
fine with also supporting kind=4 (don't forget to multiply the length by
the kind, e.g. ts.kind or more properly (but equivalently)
gfc_character_kinds[<index>].bit_size/BITS_PER_BYTE).
As follow up, I think you could do what OndÅej suggested.