This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH, RFC] Introduce -ffast-do-loop flag.
- From: Mikael Morin <morin-mikael at orange dot fr>
- To: FX <fxcoudert at gmail dot com>, Martin LiÅka <mliska at suse dot cz>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Richard Biener <richard dot guenther at gmail dot com>, Dominique d'HumiÃres <dominiq at lps dot ens dot fr>, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, williamclodius at gmail dot com, ahirst at cedint dot upm dot es
- Date: Thu, 30 Jun 2016 22:23:23 +0200
- Subject: Re: [PATCH, RFC] Introduce -ffast-do-loop flag.
- Authentication-results: sourceware.org; auth=none
- References: <6662B213-476B-4624-808D-2AC0DB33E152 at lps dot ens dot fr> <20160628121011 dot GD52409 at kam dot mff dot cuni dot cz> <CAFiYyc3AE8aWpUT7HT0zMAz67E541-Pskf16y2H1JTbunqE1vw at mail dot gmail dot com> <20160628135602 dot GB52343 at kam dot mff dot cuni dot cz> <60bcb1f6-ff54-95ac-d69d-966542a8aaa9 at suse dot cz> <12CE7112-FB2F-496E-89A8-5DA6A34DBAC8 at gmail dot com>
Le 30/06/2016 21:09, FX a Ãcrit :
Here are my thoughts on the general approach and the patch:
1. It seems there is unanimous agreement (both here, in previous PRs and on comp.lang.fortran) that loops that reach HUGE(i) are invalid code. If one of the Fortran maintainers is against it, now is the time to speak :)
Well, in the case the value of the loop variable is not used after the
loop, I would rather support it if possible and not too costly.
In that case the overflow is completely hidden, and it is possible to
produce code behaving as expected without overflowing.
2. If so, do we really need yet another option? I donât disagree with it, but others might :) Anyone in favor of simply using the faster loops all the time?
I'm on the same page here. No option please. Just let the compiler do
its best.
2b. Another warning? I would simply make it -W or -Wall.
I'm in favor of the warning flag. It makes it possible to enable/disable
individually.
3. The warning is nice, but the text isnât. First, because MAX_INT and MIN_INT will mean nothing to a Fortran coder. Can we use overflow/underflow instead? And second, because there is no reason for the loop to be infinite. Letâs just say it is invalid.
4. Finally: profile, donât speculate. Does this really make code generation easier? (and running code faster?)
Agreed on both.
Mikael