This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, RFC] Introduce -ffast-do-loop flag.


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]