While recovering from an illness here folks I have been following all of
these discussions. I think I will put in my two cents worth.
From what i can see, Paul's patch breaks nothing and fixes many things.
The only thing holding us back is fear we might break something. The
likelihood of actually breaking something is very low. The consequences
of breaking anything, worst case, is to revert a patch. (ie no consequence)
It is clear to me the value added clearly exceeds the the risks by a
lot. Therefore, as Spock would say, it is illogical to not make a
decision and move forward with this finalization patch, and commit it.
More will be advanced from making this decision from not making this
decision.
Regards,
Jerry
On 3/9/23 9:30 AM, Thomas Koenig via Fortran wrote:
Hi Paul,
-fdefault-integer-8 does indeed fix the problem with rnflow.f90 but
breaks tfft2.f90, with a type mismatch at lines 36 and 44.
integer(8), parameter :: jmul = 843314861 ! multiplicateur
integer(8), parameter :: jadd = 453816693 ! constante additive
Does the job and is portable.
I think -frwapv (as suggested by Jakub) would be the better choice.
The problem is the linear congruential pseudo-random number generators
which were much used in earlier times (and are still present in
legacy code), which violate the Fortran standards by assuming silent
truncation.
If a new optimization breaks this (widespread, but illegal) idiom,
maybe the best way to deal with it is to add -frwapv to -std=legacy.
What do you think?
Best regards
Thomas