From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20052 invoked by alias); 8 Aug 2018 08:35:38 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 20031 invoked by uid 89); 8 Aug 2018 08:35:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=BAYES_50,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=degree, H*F:D*ch, voice, 07082018 X-HELO: mout.gmx.net Received: from mout.gmx.net (HELO mout.gmx.net) (212.227.17.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 08 Aug 2018 08:35:35 +0000 Received: from [192.168.99.12] ([212.126.164.126]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LhSfM-1gHxrg36Vk-00meGk for ; Wed, 08 Aug 2018 10:35:32 +0200 Subject: Re: [Patch, Fortran] PR 57160: short-circuit IF only with -ffrontend-optimize To: fortran@gcc.gnu.org References: <707691ED-E885-4038-B493-E1E97FE96358@lps.ens.fr> From: Manfred Schwarb Message-ID: <8656c8dd-7a0b-48c0-9ff8-37319db96897@gmx.ch> Date: Wed, 08 Aug 2018 08:35:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00034.txt.bz2 Hi Janus, hi Dominique, I did not raise my voice so far, as it is not so terribly relevant I guess, nevertheless... Am 07.08.2018 um 19:14 schrieb Janus Weil: > 2018-08-07 12:11 GMT+02:00 Dominique d'Humières : >> >>> It's so easy to scream "bullshit", and so hard to find a good >>> solution. Still, we need one … >> >> Sorry if I have not been clear enough. I see only two >> sensible solutions: >> >> (1) The statu quo, closing the PR as WONTFIX > > How is that even an option?!? gfortran accepts invalid code. What's > wrong with fixing that? > > If your aim is to keep "the status quo" (read: a compiler with > gazillions of bugs), why don't we just shut down bugzilla altogether? > > >> (2) Introduce a new option, for instance >> -fshort-circuit (default) for the short-circuit evaluation >> -fno-short-circuit to force the evaluation of both expressions. > > For starters, no one will find a bug in his code if it requires > -fsome-obscure-option-that-nobody-knows. > > Also I could ask the innocent question why -fshort-circuit should be > the default, but I guess I won't bother to go there. > I think both of you are right to some degree. I think it is a (good) custom in GCC to couple major optimizations with its own option flag. And to activate it for some -Ox levels. Because IMHO it is just this, a bog ordinary optimization. And usually, optimizations which obfuscate the control flow and degrade debug-ability are deactivated at level -O0. Why can't this be handled just like any other optimization? Cheers, Manfred PS: left-to-right short-circuiting is very handy, indeed. But I think it would be wrong to nail down some behavior in gfortran which is not mandated by the standards. I rather would prefer to aggressively implement some explicitly non-standard .ANDELSE. (or similar) syntax and not to wait for the committees. FORTRAN has a long tradition of compilers driving progress and standards to follow, after all... > I still find it deeply unsatisfying that gfortran is incompatible with > other compilers on a very fundamental level. And I find it very > disturbing that no one even cares. Anyway, I'm kinda through with this > whole issue. I guess I'll just stop caring as well. > > Goodbye ... >