This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] PR 85599: warn about short-circuiting of logical expressions for non-pure functions
- From: Dominique d'Humières <dominiq at lps dot ens dot fr>
- To: Janus Weil <janus at gcc dot gnu dot org>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 12 Jul 2018 13:16:53 +0200
- Subject: Re: [Patch, Fortran] PR 85599: warn about short-circuiting of logical expressions for non-pure functions
Hi Janus,
> after the dust of the heated discussion around this PR has settled a
> bit, here is another attempt to implement at least some basic warnings
> about compiler-dependent behavior concerning the short-circuiting of
> logical expressions. …
IMO your patch is missing the only point I agree with you on this issue, i.e.,
the short-circuit evaluation and the related portability issues should be
documented.
With your patch what happens if check() is an external function?
Your patch is focusing on pr85599 and ignore pr57160.
What to do with
if(x>0 .and. sort(x)<10.0*log(x)) …
which is not portable to compilers computing the two expressions?
Cheers,
Dominique