Open vzakhari opened 1 year ago
https://github.com/nncarlson/gfortran.dg/blob/master/mvbits_1.f90 uses the following computations:
ibits=bit_size(1_4) do n=1,ibits i4=-1 call mvbits(1_4, 0,n,i4,0) j4=-1-2_4**n+2 if(i4.ne.j4)STOP 3 enddo
For example for kind*4, n goes up to 32, so 2_4**32 overflows. NVHPC compiler computes j4 into 0 in this case, while the mvbits result in i4 is 1.
n
2_4**32
j4
0
mvbits
i4
1
nag-7.0 also computes j4 to 0 in this case.
nag-7.0
https://github.com/nncarlson/gfortran.dg/blob/master/mvbits_1.f90 uses the following computations:
For example for kind*4,
n
goes up to 32, so2_4**32
overflows. NVHPC compiler computesj4
into0
in this case, while themvbits
result ini4
is1
.