Quantcast
Channel: Fortran
Viewing all articles
Browse latest Browse all 3108

loc intrinsic function returning negative integer on 32-bit Win7

$
0
0

Greetings!

I am running the following code on a 32-bit Win7 machine with /3GB option enabled. The code is compiled with option /largeaddressaware.

integer(8) :: locarr

! allocation is successful and allocerr is zero; arr uses about 30MB of memory
allocate (arr(1:length), stat = allocerr)

! loc returns negative integer
locarr = loc(arr)

The documentation says that the result type of loc is "INTEGER(4) on IA-32 architecture; INTEGER(8) on Intel® 64 architecture". I can see that the array is allocated beyond the 2GB barrier. Therefore, I suspect that there is an integer overflow because the starting address of 'arr' does not fit into integer(4). Am I correct? I think I am missing something.

I would appreciate any help / comments. The compiler version is

Version 12.0.3.175 Build 20110309

-Franz

 

 

 


Viewing all articles
Browse latest Browse all 3108

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>