> Am 26.03.2022 um 12:28 schrieb Thomas Koenig <tkoe...@netcologne.de>: > > On 25.03.22 12:34, Jakub Jelinek via Fortran wrote: >> What is the behavior with a RANGE_EXPR when one has { [0..10] = ++i; >> }, is that applying the side-effects 11 times or once ? > > For side effects during the evaluation of expression, Fortran has a > clear "if you depend on it, it's your fault" rule. In F 2018, it says > > 10.1.7 Evaluation of operands > > 1 It is not necessary for a processor to evaluate all of the operands of > an expression, or to evaluate entirely each operand, if the value of the > expression can be determined otherwise. > > Also, the semantics of > > a(a:b) = expr > > say that the expression on the LHS is evaluated only once before > assignment. So, anything that looks like that should be translated > to > > tmp = ++i; > [0..10] = tmp; Note I was not trying to question middle-end semantic here but gfortran se_expr (?) one. Is there a Fortan input where Jakob’s patch would cause a side-effect to be dropped and is that valid? Richard. > >
Re: [PATCH] fortran: Fix up initializers of param(0) PARAMETERs [PR103691]
Richard Biener via Gcc-patches Sat, 26 Mar 2022 10:13:36 -0700
- [PATCH] fortran: Fix up initializers of par... Jakub Jelinek via Gcc-patches
- Re: [PATCH] fortran: Fix up initialize... Tobias Burnus
- Re: [PATCH] fortran: Fix up initia... Richard Biener via Gcc-patches
- Re: [PATCH] fortran: Fix up in... Jakub Jelinek via Gcc-patches
- Re: [PATCH] fortran: Fix u... Richard Biener via Gcc-patches
- Re: [PATCH] fortran: ... Jakub Jelinek via Gcc-patches
- Re: [PATCH] fortran: Fix u... Thomas Koenig via Gcc-patches
- Re: [PATCH] fortran: ... Richard Biener via Gcc-patches