This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/85599] Prevent short-circuiting of logical expressions for non-pure functions
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 17 May 2018 06:52:57 +0000
- Subject: [Bug middle-end/85599] Prevent short-circuiting of logical expressions for non-pure functions
- Auto-submitted: auto-generated
- References: <bug-85599-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85599
--- Comment #23 from janus at gcc dot gnu.org ---
(In reply to Thomas Koenig from comment #21)
> If we make guarantees that the standard does not, we will be
> creating our own language
I certainly don't want to create my own language. I'm trying to use the freedom
that the Fortran standard (unfortunately) gives in this area in a reasonable
way.
> (and people will get problems moving
> code to another compiler).
We do have problems with compiler-dependent behavior already. The behavior I'm
proposing is consistent with what ifort, PGI and flang do.
> Warn, yes. This is the kind of thing that -Wsurprising is for,
> so people will get something with -Wall. (I volunteer for that).
What do you want to warn about? And how?
> Optimize, yes. This could also be integrated with the warning.
Optimize, yes, but not at the price of changing results.
> Change the language, no.
Agreed.