https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85599
--- Comment #10 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Dumping the original tree of the test in comment 0 gives
...
lazy ()
{
static logical(kind=4) check (void);
logical(kind=4) flag;
flag = 0;
flag = check () && flag;
flag = flag && check ();
}
...
Am I mistaken to read this as being handled by the middle-end? If yes, the
situation is discussed in pr57160 comment 1.
> *****
> 7.1.4 Evaluation of operations
> 2 The evaluation of a function reference shall neither affect nor be affected
> by the evaluation of any other entity within the statement.
> *****
Does it means that 'check' has to be evaluated in
if (flag) flag = check ()
even if flag==.false. ?