[Bug tree-optimization/79744] [7 Regression] The polyhedron test rnflow.f90 is miscompiled with -O3 after r236361

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 28 10:36:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79744

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ah, I have

--- /space/rguenther/src/pb05/lin/source/rnflow.f90     2005-10-11
23:53:34.000000000 +0200
+++ /space/rguenther/src/pb11/lin/source/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


I think that's a know bug resolved as INVALID (bogus code in rnflow).


More information about the Gcc-bugs mailing list