Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Issue with dshiftl and dshiftr

William_D_3
Beginner
790 Views
Consider the following fortran 2008 program. 

program foo
  integer(kind=8) i,j
  i = z'1111111111111111'
  j = z'4444444444444444'
  do n=0,64
    print "(i2,': ',z16,2x,z16)",n,dshiftl(i,j,n),dshiftr(i,j,n)
  end do
end program foo

 

When compiled with Intel Fortran Compiler 14.0.3.174 build 20140422 or 15.0.2.164 build 20150121, it produces the incorrect output for n=0 and n=64,

 0: 5555555555555555  5555555555555555
...
64: 5555555555555555  5555555555555555

It should produce

 0: 1111111111111111  4444444444444444
...
64: 4444444444444444  1111111111111111

This was run on a RHEL 6.6 computer with a haswell processor.

0 Kudos
4 Replies
Kevin_D_Intel
Employee
790 Views

Thank you for the report. I'm also seeing the same with 16.0. We will investigate this further.

0 Kudos
Kevin_D_Intel
Employee
790 Views

I reported this issue to the Fortran run-time developer (see internal tracking id below) and will keep this thread updated with the status of a fix as I learn it. Thank you for the convenient reproducer.

(Internal tracking id: DPD200574010)

(Resolution Update on 12/30/2016): This defect is fixed in the Intel® Parallel Studio XE 2017 Initial Release (ifort Version 17.0.0.098 Build 20160721 - PSXE 2017.0.035 / CnL 2017.0.098 - Linux)

0 Kudos
jimdempseyatthecove
Honored Contributor III
790 Views

Shouldn't the correct DSHIFTL for count of 64 produce

444444440000000

Jim Dempsey

 

0 Kudos
Kevin_D_Intel
Employee
790 Views

Pardon the delayed notification. I confirmed this defect was fixed in the Intel® Parallel Studio XE 2017 initial release. The fix is present in the latest PSXE 2017 Update 1 also.

@Jim – The results the OP noted as expected appear to be correct but let me know if something is being overlooked.

0 Kudos
Reply