Re: [patch, fortran, 4.9] Improve efficiency of array constructor operators

2013-03-29 Thread Tobias Burnus
Am 29.03.2013 14:42, schrieb Thomas Koenig: I wrote: 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[].bit_size/BITS_

Re: [patch, fortran, 4.9] Improve efficiency of array constructor operators

2013-03-29 Thread Thomas Koenig
I wrote: 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[].bit_size/BITS_PER_BYTE). I'll do that. Oops, it turns out

Re: [patch, fortran, 4.9] Improve efficiency of array constructor operators

2013-03-28 Thread Thomas Koenig
Hi Tobias, I have committed the two approved patches, with the issues that you have noted fixed. Thanks a lot for the reviews! 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

Re: [patch, fortran, 4.9] Improve efficiency of array constructor operators

2013-03-28 Thread Tobias Burnus
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: [...] wh

Re: [patch, fortran, 4.9] Improve efficiency of array constructor operators

2013-03-28 Thread Thomas Koenig
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: + if (op2->expr_type == EXPR_CONSTANT) +sc

Re: [patch, fortran, 4.9] Improve efficiency of array constructor operators

2013-03-26 Thread 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: + if (op2->expr_type == EXPR_CONSTANT) +scalar = gfc_copy_expr (op2); + else +scal

Re: [patch, fortran, 4.9] Improve efficiency of array constructor operators

2013-03-26 Thread Tobias Burnus
Thomas Koenig wrote: this patch finally makes the idiom if (any([a,b,c] < eps)) then equivalent to if (a 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 gener

Re: [patch, fortran, 4.9] Improve efficiency of array constructor operators

2013-03-24 Thread Thomas Koenig
Hello world, this updated patch fixes a regression in my previous patch, with a test case for that regression also attached. Regression-tested. OK for trunk? Thomas 2013-03-24 Thomas Koenig PR fortran/55806 * frontend-passes.c (optimize_code): Keep track of

[patch, fortran, 4.9] Improve efficiency of array constructor operators

2013-03-17 Thread Thomas Koenig
Hello world, this patch finally makes the idiom if (any([a,b,c] < eps)) then equivalent to if (a PR fortran/55806 * frontend-passes.c (optimize_code): Keep track of current code to make code insertion possible. (combine_array_constructor): New function.