public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/64104] New: [F2003][IEEE] Allow IEEE functions in specification expressions
@ 2014-11-28 14:24 fxcoudert at gcc dot gnu.org
  2014-11-28 14:25 ` [Bug fortran/64104] " fxcoudert at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-28 14:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64104
           Summary: [F2003][IEEE] Allow IEEE functions in specification
                    expressions
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fxcoudert at gcc dot gnu.org

Reported by James Van Buskirk on comp.lang.fortran:

Have you tested whether gfortran accepts IEEE functions syntactically?
The following should be OK I think, but gfortran shows a lot of errors.

module funcs
   use IEEE_ARITHMETIC
   use IEEE_EXCEPTIONS
   implicit none
   integer, parameter :: ep = selected_real_kind(18,4931)
   integer, parameter :: ik4 = selected_int_kind(9)
   integer, parameter :: ik8 = selected_int_kind(18)
   contains
      subroutine test_specification(x)
         real(ep) x
         integer src(IEEE_SELECTED_REAL_KIND())
         integer datatype(merge(1,2,IEEE_SUPPORT_DATATYPE(x)))
         integer denormal(merge(1,2,IEEE_SUPPORT_DENORMAL(x)))
         integer divide(merge(1,2,IEEE_SUPPORT_DIVIDE(x)))
         integer inf(merge(1,2,IEEE_SUPPORT_INF(x)))
         integer io(merge(1,2,IEEE_SUPPORT_IO(x)))
         integer nan(merge(1,2,IEEE_SUPPORT_NAN(x)))
         integer rounding(merge(1,2,IEEE_SUPPORT_ROUNDING(IEEE_TO_ZERO,x)))
         integer sqrt(merge(1,2,IEEE_SUPPORT_SQRT(x)))
         integer standard(merge(1,2,IEEE_SUPPORT_STANDARD(x)))
         integer 
underflow_control(merge(1,2,IEEE_SUPPORT_UNDERFLOW_CONTROL(x)))
         integer flag(merge(1,2,IEEE_SUPPORT_FLAG(IEEE_INEXACT,x)))
         integer halting(merge(1,2,IEEE_SUPPORT_HALTING(IEEE_INEXACT)))
         src = 1
         write(*,*) 'src',size(src), src
         datatype = 1
         write(*,*) 'datatype',size(datatype),datatype
         denormal = 1
         write(*,*) 'denormal',size(denormal),denormal
         divide = 1
         write(*,*) 'divide',size(divide),divide
         inf = 1
         write(*,*) 'inf',size(inf),inf
         io = 1
         write(*,*) 'io',size(io),io
         nan = 1
         write(*,*) 'nan',size(nan),nan
         rounding = 1
         write(*,*) 'rounding',size(rounding),rounding
         sqrt = 1
         write(*,*) 'sqrt',size(sqrt),sqrt
         standard = 1
         write(*,*) 'standard',size(standard),standard
         underflow_control = 1
         write(*,*) 
'underflow_control',size(underflow_control),underflow_control
         flag = 1
         write(*,*) 'flag',size(flag),flag
         halting = 1
         write(*,*) 'halting',size(halting),halting
      end subroutine test_specification
      subroutine test_constant(x)
         real(ep) x
         real(IEEE_SELECTED_REAL_KIND()) src
         integer(merge(ik4,ik8,IEEE_SUPPORT_DATATYPE(x))) datatype
         integer(merge(ik4,ik8,IEEE_SUPPORT_DENORMAL(x))) denormal
         integer(merge(ik4,ik8,IEEE_SUPPORT_DIVIDE(x))) divide
         integer(merge(ik4,ik8,IEEE_SUPPORT_INF(x))) inf
         integer(merge(ik4,ik8,IEEE_SUPPORT_IO(x))) io
         integer(merge(ik4,ik8,IEEE_SUPPORT_NAN(x))) nan
         integer(merge(ik4,ik8,IEEE_SUPPORT_ROUNDING(IEEE_TO_ZERO,x))) 
rounding
         integer(merge(ik4,ik8,IEEE_SUPPORT_SQRT(x))) sqrt
         integer(merge(ik4,ik8,IEEE_SUPPORT_STANDARD(x))) standard
         integer(merge(ik4,ik8,IEEE_SUPPORT_UNDERFLOW_CONTROL(x))) 
underflow_control
         integer(merge(ik4,ik8,IEEE_SUPPORT_FLAG(IEEE_INEXACT,x))) flag
         integer(merge(ik4,ik8,IEEE_SUPPORT_HALTING(IEEE_INEXACT))) halting
         src = 1
         write(*,*) 'src',kind(src), src
         datatype = 1
         write(*,*) 'datatype',kind(datatype),datatype
         denormal = 1
         write(*,*) 'denormal',kind(denormal),denormal
         divide = 1
         write(*,*) 'divide',kind(divide),divide
         inf = 1
         write(*,*) 'inf',kind(inf),inf
         io = 1
         write(*,*) 'io',kind(io),io
         nan = 1
         write(*,*) 'nan',kind(nan),nan
         rounding = 1
         write(*,*) 'rounding',kind(rounding),rounding
         sqrt = 1
         write(*,*) 'sqrt',kind(sqrt),sqrt
         standard = 1
         write(*,*) 'standard',kind(standard),standard
         underflow_control = 1
         write(*,*) 
'underflow_control',kind(underflow_control),underflow_control
         flag = 1
         write(*,*) 'flag',kind(flag),flag
         halting = 1
         write(*,*) 'halting',kind(halting),halting
      end subroutine test_constant
end module funcs

program ieee
   use funcs
   implicit none
   real(ep) x
   call test_specification(x)
   call test_constant(x)
end program ieee


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/64104] [F2003][IEEE] Allow IEEE functions in specification expressions
  2014-11-28 14:24 [Bug fortran/64104] New: [F2003][IEEE] Allow IEEE functions in specification expressions fxcoudert at gcc dot gnu.org
@ 2014-11-28 14:25 ` fxcoudert at gcc dot gnu.org
  2015-04-22 11:58 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-28 14:25 UTC (permalink / raw)
  To: gcc-bugs

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

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-11-28
           Assignee|unassigned at gcc dot gnu.org      |fxcoudert at gcc dot gnu.org
   Target Milestone|---                         |5.0
     Ever confirmed|0                           |1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/64104] [F2003][IEEE] Allow IEEE functions in specification expressions
  2014-11-28 14:24 [Bug fortran/64104] New: [F2003][IEEE] Allow IEEE functions in specification expressions fxcoudert at gcc dot gnu.org
  2014-11-28 14:25 ` [Bug fortran/64104] " fxcoudert at gcc dot gnu.org
@ 2015-04-22 11:58 ` jakub at gcc dot gnu.org
  2015-07-16  9:16 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-04-22 11:58 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|5.0                         |5.2

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 5.1 has been released.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/64104] [F2003][IEEE] Allow IEEE functions in specification expressions
  2014-11-28 14:24 [Bug fortran/64104] New: [F2003][IEEE] Allow IEEE functions in specification expressions fxcoudert at gcc dot gnu.org
  2014-11-28 14:25 ` [Bug fortran/64104] " fxcoudert at gcc dot gnu.org
  2015-04-22 11:58 ` jakub at gcc dot gnu.org
@ 2015-07-16  9:16 ` rguenth at gcc dot gnu.org
  2015-08-07 15:02 ` fxcoudert at gcc dot gnu.org
  2015-08-07 15:13 ` fxcoudert at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-07-16  9:16 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|5.2                         |5.3

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 5.2 is being released, adjusting target milestone to 5.3.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/64104] [F2003][IEEE] Allow IEEE functions in specification expressions
  2014-11-28 14:24 [Bug fortran/64104] New: [F2003][IEEE] Allow IEEE functions in specification expressions fxcoudert at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-07-16  9:16 ` rguenth at gcc dot gnu.org
@ 2015-08-07 15:02 ` fxcoudert at gcc dot gnu.org
  2015-08-07 15:13 ` fxcoudert at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2015-08-07 15:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Author: fxcoudert
Date: Fri Aug  7 15:02:15 2015
New Revision: 226723

URL: https://gcc.gnu.org/viewcvs?rev=226723&root=gcc&view=rev
Log:
        PR fortran/64104

        * expr.c (gfc_check_init_expr): Allow some IEEE functions in
        constant expressions.
        (external_spec_function): Allow some IEEE functions in specification
        expressions.
        * simplify.c (gfc_simplify_ieee_selected_real_kind): Remove.
        (simplify_ieee_selected_real_kind, simplify_ieee_support,
        matches_ieee_function_name, gfc_simplify_ieee_functions): New
        functions.
        * gfortran.h (gfc_simplify_ieee_selected_real_kind): Remove
        prototype.
        (gfc_simplify_ieee_functions): Add prototype.

        * gfortran.dg/ieee/ieee_8.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/ieee/ieee_8.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/simplify.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/64104] [F2003][IEEE] Allow IEEE functions in specification expressions
  2014-11-28 14:24 [Bug fortran/64104] New: [F2003][IEEE] Allow IEEE functions in specification expressions fxcoudert at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-08-07 15:02 ` fxcoudert at gcc dot gnu.org
@ 2015-08-07 15:13 ` fxcoudert at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2015-08-07 15:13 UTC (permalink / raw)
  To: gcc-bugs

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

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|5.3                         |6.0

--- Comment #5 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Fixed on trunk.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-08-07 15:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-28 14:24 [Bug fortran/64104] New: [F2003][IEEE] Allow IEEE functions in specification expressions fxcoudert at gcc dot gnu.org
2014-11-28 14:25 ` [Bug fortran/64104] " fxcoudert at gcc dot gnu.org
2015-04-22 11:58 ` jakub at gcc dot gnu.org
2015-07-16  9:16 ` rguenth at gcc dot gnu.org
2015-08-07 15:02 ` fxcoudert at gcc dot gnu.org
2015-08-07 15:13 ` fxcoudert at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).