Why will this code compile using ifort compiler and not when using gfortran compiler? Help!

Posted by CuriousCompiler on Stack Overflow See other posts from Stack Overflow or by CuriousCompiler
Published on 2011-01-06T22:04:07Z Indexed on 2011/01/06 22:54 UTC
Read the original article Hit count: 265

Filed under:
|
|

I'm rewriting some code to make a program compile with the gfortran compiler as opposed to ifort compiler I usually use. The code follows:

_Subroutine SlideBits (WORD, BITS, ADDR) 

Implicit None  
Integer(4) WORD  
Integer(4) BITS  
Integer(4) ADDR  
Integer(4) ADDR1 

ADDR1 = 32 - ADDR  
WORD = (WORD .And. (.Not.ISHFT(1,ADDR1))) .Or. ISHFT(BITS,ADDR1)  

End_ 

When I compile the above code using the gfortran compiler, I recieve this error:

WORD = (WORD .And. (.Not.ISHFT(1,ADDR1))) .Or. ISHFT(BITS,ADDR1) 

Error: Operand of .NOT. operator at (1) is INTEGER(4)  

All three of the variables coming into the subroutine are integers. I've looked around a bit and the gfortran wiki states that the gfortran compiler should be able to handle logical statments being applied to integer values. Several other sites I've visited either quote from the gnu wiki or agree with it. This is the first time I've seen this error as the Intel Fortran compiler (ifort) I normally use compiles cleanly.

© Stack Overflow or respective owner

Related posts about fortran

Related posts about intel