This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran] PR 57160: short-circuit IF only with -ffrontend-optimize
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Janus Weil <janus at gcc dot gnu dot org>
- Cc: Dominique d'Humières <dominiq at lps dot ens dot fr>, Adam Hirst <adam at aphirst dot karoo dot co dot uk>, gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, VandeVondele Joost <Joost dot VandeVondele at mat dot ethz dot ch>
- Date: Tue, 24 Jul 2018 18:41:58 +0300
- Subject: Re: [Patch, Fortran] PR 57160: short-circuit IF only with -ffrontend-optimize
- References: <D5E8D1C6-CC0E-4EA8-A5C0-EF581D0399A0@lps.ens.fr> <CAKwh3qiETg4zjTpr4+JE8uV+Uu8rZXUqjfp_rfuh82SKd_oTSw@mail.gmail.com>
On Tue, Jul 24, 2018 at 4:46 PM, Janus Weil <janus@gcc.gnu.org> wrote:
> 2018-07-24 11:12 GMT+02:00 Dominique d'Humières <dominiq@lps.ens.fr>:
> > If you want non short-circuit evaluation, introduce an option for it.
>
> Your argument could easily be reversed: If you want short-circuiting,
> go introduce an option for it.
>
> I'm sure we'll not get anywhere this way, and I do think that Joost's
> suggestion to avoid short-circuiting with -O0 (and possibly -Og) is
> very reasonable: People who want maximum performance still get that
> with -O3, and at the same time they can still check their codes for
> errors with -O0.
>
I agree with Dominique, that this would be better as a separate option.
Optimization bugs that pop up at different optimization levels are hard
enough for users to figure out, without the frontend generating different
code to begin with depending on the optimization level. Also, with a
separate option it would be easy to check how it affects performance at
different optimization levels.
What about making it a -fcheck=short-circuit-logicals (or however you want
to spell it?) option, that also would be enabled with -fcheck=all?
--
Janne Blomqvist