# AMD compiler bug?

**URL:** <https://fortran-lang.discourse.group/t/amd-compiler-bug/6954>\
**Category:** Help\
**Created:** [December 7, 2023, 8:56pm UTC](https://fortran-lang.discourse.group/t/amd-compiler-bug/6954 "2023-12-07T20:56:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harper](https://avatars.discourse-cdn.com/v4/letter/h/b5ac83/32.png) [@Harper](https://fortran-lang.discourse.group/u/Harper)\
**Post date:** [December 7, 2023, 8:56pm UTC](https://fortran-lang.discourse.group/t/amd-compiler-bug/6954/1 "2023-12-07T20:56:10Z")

</div>

The program below appears to expose two bugs in the AMD Fortran compiler, one in treating ES42.33E4 as if it were ES42.33 for double precision huge, the other in printing Inf instead of a finite value for quadruple precision huge.

```auto
program hugetest
  use ieee_arithmetic
  implicit none
  integer,parameter:: dp = selected_real_kind(15), qp = selected_real_kind(33)
  character(*),parameter:: fmt = '(1X,A,SP,ES42.33E4,A)' 
  print *,'IEEE OK for kinds dp,qp?', &
       ieee_support_datatype(1._dp),ieee_support_datatype(1._qp)
  print fmt,'huge(1.0_dp) = "',huge(1.0_dp),'"'
  print fmt,'huge(1.0_qp) = "',huge(1.0_qp),'"'
end program hugetest

```

With AMD flang the output is

```auto
 IEEE OK for kinds dp,qp? T T
 huge(1.0_dp) = " +1.797693134862315708145274237317044+308"
 huge(1.0_qp) = " +Inf"

```

but with both gfortran and ifort the output, which I believe to be correct, is

```auto
IEEE OK for kinds dp,qp? T T
 huge(1.0_dp) = "+1.797693134862315708145274237317044E+0308"
 huge(1.0_qp) = "+1.189731495357231765085759326628007E+4932"

```
