The unreachable statements: why the errors appear?

The unreachable statements: why the errors appear?

Ivan S.的头像

Please look at this extract from a program code:

INTEGER(KIND=4) :: NI
REAL(KIND=8) :: C,SH,R,PSH
REAL(KIND=8), DIMENSION(2) :: EP 
REAL(KIND=8), PARAMETER :: MP=EPSILON(1.D0)
...
EP(1)=SH+C*DSIN(SH)
WRITE(*,*) 'EP(1)-1',EP(1)
NI=2
WRITE(*,*) 'EP(NI)-1',EP(2)
DO WHILE (.TRUE.)
  EP(NI)=SH+C*DSIN(EP(NI-1))      ! error #12192: [SV] unreachable statement
  WRITE(*,*) 'EP(NI)-2',EP(NI)    ! error #12192: [SV] unreachable statement
  R=DABS(EP(NI)-EP(NI-1))         ! error #12192: [SV] unreachable statement
    IF(R-0.D0<=MP) EXIT
    EP(NI-1)=EP(NI)               ! error #12192: [SV] unreachable statement
END DO
PSH=EP(NI)                        ! error #12192: [SV] unreachable statement
...

I see the errors, but in fact I have the following output:

EP(1)-1    2.83115703117778  <- EP(1)
 EP(NI)-1   0.000000000000000E+000 <- EP(2)
 EP(NI)-2   2.83115685915829 <- EP(NI)
 EP(NI)-2   2.83115685928421 <- EP(NI)
 EP(NI)-2   2.83115685928411 <- EP(NI)
 EP(NI)-2   2.83115685928411 <- EP(NI)

Why do I get the errors that lines with comments are the unreachable statements? What’s wrong?

2 帖子 / 0 new
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
Steve Lionel (Intel)的头像

You've enabled the Static Verifier (also called Source Checker) option, and it evidently doesn't understand something.  Unfortunately, this option doesn't do a good job with Fortran code. Sometimes it helps, but there are often complaints that are unjustified.

Steve

登陆并发表评论。