https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111022

--- Comment #13 from john.harper at vuw dot ac.nz ---
Hmmm. If I read anlauf correctly, our versions of ifort differ when 
writing ES0.0E0 and EN0.0E0 with the value 666.0. Both give the same 
correct numerical values but one version omits the E in the output. 
Omitting it does write the value in the shortest possible space but 
disobeys the F2018 and F2023 standards, where 13.7.2.3.4 Table 13.2 and 
13.7.2.3.5 Table 13.3 require ENw.dE0 and ESw.dE0 to include E in the 
output.

  On Sun, 27 Aug 2023, anlauf at gcc dot gnu.org wrote:

> Date: Sun, 27 Aug 2023 19:41:10 +0000
> From: anlauf at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org>
> To: John Harper <john.har...@vuw.ac.nz>
> Subject: [Bug libfortran/111022] ES0.0E0 format gave ES0.dE0 output with d too
>      high.
> Resent-Date: Mon, 28 Aug 2023 07:41:23 +1200 (NZST)
> Resent-From: <john.har...@vuw.ac.nz>
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111022
>
> --- Comment #10 from anlauf at gcc dot gnu.org ---
> (In reply to Jerry DeLisle from comment #9)
>> I am using this:
>>
>> program teste0es0en0
>>   integer,parameter::p1 = kind(1e0), p2 = kind(1d0), &
>>        p3 = selected_real_kind(precision(1.0_p2)+1), &
>>        hp = selected_real_kind(precision(1.0_p3)+1), &
>>        p4 = merge(hp,p3,hp>0) ! in gfortran p4 /= p3, in ifort p4 == p3
>>   character(*),parameter:: fmt(3) = "(A,1X,"//[" E","ES","EN"]//"0.0E0) "
>>   integer ifmt
>>   write(*,"(A,4(1X,I0))") 'real kinds',p1,p2,p3,p4
>>   do ifmt = 1,3
>>      write(*, fmt(ifmt)) 'With '//fmt(ifmt), 666.0_p1
>>      write(*, fmt(ifmt)) 'With '//fmt(ifmt), 666.0_p2
>>      write(*, fmt(ifmt)) 'With '//fmt(ifmt), 666.0_p3
>>      if(p3/=p4) write(*, fmt(ifmt)) 'With '//fmt(ifmt), 666.0_p4
>>   end do
>> end program teste0es0en0
>>
>> And I get the following output with some test patching:
>>
>> $ ./a.out
>> real kinds 4 8 10 16
>> With (A,1X, E0.0E0)  1.E+3
>> With (A,1X, E0.0E0)  1.E+3
>> With (A,1X, E0.0E0)  1.E+3
>> With (A,1X, E0.0E0)  1.E+3
>> With (A,1X,ES0.0E0)  7.E+2
>> With (A,1X,ES0.0E0)  7.E+2
>> With (A,1X,ES0.0E0)  7.E+2
>> With (A,1X,ES0.0E0)  7.E+2
>> With (A,1X,EN0.0E0)  666.
>> With (A,1X,EN0.0E0)  666.
>> With (A,1X,EN0.0E0)  666.
>> With (A,1X,EN0.0E0)  666.
>
> Intel does not like E0.0E0, thus running with do ifmt = 2,3 gives:
>
> real kinds 4 8 16 16
> With (A,1X,ES0.0E0) 7.+2
> With (A,1X,ES0.0E0) 7.+2
> With (A,1X,ES0.0E0) 7.+2
> With (A,1X,EN0.0E0) 666.+0
> With (A,1X,EN0.0E0) 666.+0
> With (A,1X,EN0.0E0) 666.+0
>
> -- 
> You are receiving this mail because:
> You reported the bug.
>


-- John Harper, School of Mathematics and Statistics
Victoria Univ. of Wellington, PO Box 600, Wellington 6140, New Zealand.
e-mail john.har...@vuw.ac.nz

Reply via email to