Bad result when I compil with /O3 and /check:nobounds

Bad result when I compil with /O3 and /check:nobounds

- Compiler XE 2011 Update 8 build 278

- option /O3 and /check:nobounds

      IMPLICIT DOUBLE PRECISION (A-H,O-Z)

      DIMENSION RIGA(3,3,3),RIGRES(6),RIGA2(3,3,3),RIGA3(3,3,3)

      DATA RIGRES /0.D0,  305722446.032357d0,               0.D0,
     .             0.D0, -305722446.032357d0, 8152598.56086286d0/

      DATA RIGA   /
     . 1356573448.12706d0 ,               0.d0,                0.d0,
     . 0.d0               , 7643061150.80893d0,  18.7499988500600d0,
     . 0.d0               , 18.7499988500600d0, 0.999999938669865d0,
     . -1356573448.12706d0,               0.d0,                0.d0,
     . 0.d0               ,-7643061150.80893d0, -18.7499988500600d0,
     . 0.d0               , 305722446.032357d0, 0.499999969334933d0,
     . 1356573448.12706d0 ,               0.d0,                0.d0,
     . 0.d0               , 7643061150.80893d0, -305722446.032357d0,
     . 0.d0               ,-305722446.032357d0,  16305197.1217257d0/
        
      RIG33 = 16305197.1217257D0

      DO I=1,3
         DO J=1,3
            DO K=1,3
              II= I
              JJ= J
              IF (K.GE.2) JJ= J+3
              IF (K.EQ.3) II= I+3
              write(6,*)'K',K
              RIGA2(I,J,K)= RIGA(I,J,K)- RIGRES(II)*RIGRES(JJ)/RIG33
            END DO
         END DO
      END DO
 
      WRITE(6,*)'RIGA2(2,2,1)',RIGA2(2,2,1)
      
      DO I=1,3
         DO J=1,3
            DO K=1,3
              II= I
              JJ= J
              IF (K.GE.2) JJ= J+3
              IF (K.EQ.3) II= I+3
              RIGA3(I,J,K)= RIGA(I,J,K)- RIGRES(II)*RIGRES(JJ)/RIG33
            END DO
         END DO
      END DO
      WRITE(6,*)'RIGA3(2,2,1)',RIGA3(2,2,1)    
      END

Result :

riga2=1910765287.7

riga3=13375357013.9

if I remove "write(6,*) 'K',K"  , the result : riga2 = riga3

With Compiler PRO 11.1 build 060 it's OK

Thank you. I'm sorry for my english (I 'm french)

AnhangGröße
Herunterladen test.for1.64 KB
3 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Steve Lionel (Intel)

I can see the bad result in a compiler as recent as version 12.1.344 (Composer XE 2011 Update 11), but the 13.0 compiler (Composer XE 2013) gets it right.  Please update to the current version.

Steve

Thank you. I update to the version 13.0

Melden Sie sich an, um einen Kommentar zu hinterlassen.