gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1562 Posts in 515 Topics by 750 Members - Latest Member: rickl July 24, 2021, 11:29:43 PM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  Windows  |  Bug in 17.0.2 compiler with -m64
gfx
gfxgfx
 

Author Topic: Bug in 17.0.2 compiler with -m64  (Read 2310 times)

mecej4

  • Jr. Member
  • **
  • Posts: 70
Bug in 17.0.2 compiler with -m64
« on: October 04, 2017, 09:45:54 PM »
The following code involves only integer variables. An array is initialized with BOZ constants in a DATA statement. When the code is compiled with -m32, the output shows the same values for im as in the DATA statement, which is what was expected. When run with -m64, however, the output is all zeros for im!


In both runs, the compiler used was the 17.0.2 version for Windows.


Code: [Select]
program tst
implicit none
integer i
do i=1,5
   call dmach(i)
end do


end program


subroutine dmach(i)
implicit none
integer i
integer im(10)
data im/Z'00000000',Z'00100000', &
        Z'FFFFFFFF',Z'7FEFFFFF', &
        Z'00000000',Z'3CA00000', &
        Z'00000000',Z'3CB00000', &
        Z'509F79FF',Z'3FD34413'/
if(i.lt.1.or.i.gt.5)stop 'D1MACH(arg < 1 or arg > 5)'
print '(I2,2x,2Z10)',i,im(2*i-1),im(2*i)
return
end subroutine dmach

mecej4

  • Jr. Member
  • **
  • Posts: 70
Re: Bug in 17.0.2 compiler with -m64
« Reply #1 on: October 04, 2017, 10:16:16 PM »
Here is an even simpler program with the same bug:

Code: [Select]
program babap
implicit none
integer baba(2)
data baba /Z'BABABABA',Z'ABABABAB' /
!
print *,baba
end program

forumadmin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 319
Re: Bug in 17.0.2 compiler with -m64
« Reply #2 on: October 05, 2017, 09:42:15 AM »
Absoft support has duplicated this issue and it is under further investigation. Until a fix is available
you can force correct behavior by using an undocumented option:  -YBOZTYPE=INT
This option changes the way the compiler interprets the KIND of BOZ source constants. While it
should not be necessary in this case, using the option will fix the problem.


c:\Absoft17.0>type boz_bug.f90
program babap
implicit none
integer baba(2)
data baba /Z'BABABABA',Z'ABABABAB' /
!
print *,baba
end program


c:\Absoft17.0>af90 -m64 boz_bug.f90
c:\Absoft17.0>boz_bug.exe
   0  0


c:\Absoft17.0>af90 -m64 -YBOZTYPE=INT boz_bug.f90
c:\Absoft17.0>boz_bug.exe
  -1162167622 -1414812757






mecej4

  • Jr. Member
  • **
  • Posts: 70
Re: Bug in 17.0.2 compiler with -m64
« Reply #3 on: October 05, 2017, 12:02:08 PM »
Thanks for the fast response and the workaround.

Absoft User Forum  |  Support  |  Windows  |  Bug in 17.0.2 compiler with -m64
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!