nncarlson / gfortran.dg

The GFortran testsuite rigged for testing other Fortran compilers
7 stars 2 forks source link

IEEE functions used in constant expressions in ieee_8.f90 #22

Closed nncarlson closed 6 years ago

nncarlson commented 6 years ago

Thought this was a NAG bug, but they bounced this back to me. Technical corrigendum 4 to the 2008 standard corrected IEEE_SUPPORT_HALTING, IEEE_SUPPORT_FLAG, and IEEE_SUPPORT_ROUNDING from inquiry functions (okay for constant expressions) to transformational functions, which cannot be used in constant expressions. Note that this is reflected in the 2018 draft standard document too. So this bit of ieee_8.f90 is not conforming:

  logical, parameter :: l1 = ieee_support_halting(ieee_overflow)
  logical, parameter :: l2 = ieee_support_flag(ieee_overflow)
  logical, parameter :: l3 = ieee_support_flag(ieee_overflow, 0.)
  logical, parameter :: l4 = ieee_support_rounding(ieee_to_zero)
  logical, parameter :: l5 = ieee_support_rounding(ieee_to_zero, 0.d0)
  logical, parameter :: l6 = xxx(ieee_to_zero, 0.d0)
  logical, parameter :: l7 = yyy(ieee_to_zero, 0.d0)

Note that xxx and yyy are renames of those functions.

janusw commented 6 years ago

duplicate of #21!

nncarlson commented 6 years ago

Ha! I should have looked to see what activity happened overnight :)

nncarlson commented 6 years ago

I mistook Themos' email as direct correspondence (I fed my NAG bugs to him directly), but it was coming from github.