On Wed, 8 Mar 2023, Thomas Koenig wrote:

> On 08.03.23 15:55, Paul Richard Thomas via Fortran wrote:
> > As noted below, rnflow.f90 hangs with the unpatched mainline at -O3 but
> > runs successfully at -O2.
> 
> I can confirm that.
> 
> > I presume that this is a serious regression since it involves optimization?
> > Which component should I post it against?
> 
> Probably against tree-optimization.  If later analysis determines that
> it is something else, people will reassign it.
> 
> This one probably calls for bisection.

I have the following local change to rnflow with that I can't reproduce:

--- rnflow.f90.orig     2016-06-01 14:50:16.922376347 +0200
+++ rnflow.f90  2016-06-01 14:56:54.739045162 +0200
@@ -884,6 +884,7 @@
 !     generation maison d'une valeur pseudo-aleatoire uniforme sur (0,1)
 !
       integer, intent (inout) :: jsee               ! germe courant
+      integer(kind=8) :: jsee_long
       integer, parameter   :: jmul =  843314861     ! multiplicateur
       integer, parameter   :: jadd =  453816693     ! constante additive
       integer, parameter   :: j230 = 1073741824     ! 2 puissance 30
@@ -899,7 +900,9 @@
 !CRAY - The following multiply must be done with 64 bits (not 46 bits)
 !       The algoritm depends on the overflow characteristics of 
 !       a 32 or 64 bit multiply.
-      jsee = jsee * jmul + jadd
+      jsee_long = jsee;
+      jsee_long = jsee_long * jmul + jadd
+      jsee = jsee_long;
 !CRAY - Change to avoid 32 bit integer dependency
       !
       !  The original line is needlessly dependent on the

the existing comment already explains the issue.  I suppose
-fdefault-integer-8 would also work around the issue?

ISTR there is an old (closed invalid) bugreport about this as well.

Richard.

Reply via email to