This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/30694] New: minval/maxval with +/-Inf


This is strange:

$ cat minval.f90
program main
  integer :: i
  data i /z'7f800000'/
  real :: a(1)
  a(1) = transfer(i,a(1))  ! a(1) contains +Inf
  print *,a(1), minval(a)
  if (a(1) > minval(a)) print *,"Strange..."
end program main
$ gfortran minval.f90
$ ./a.out
      +Infinity  3.4028235E+38
 Strange...

Ifort gets this right:

$ ifort minval.f90
$ ./a.out
 Infinity       Infinity

We should really be initializing our starting values to +/-Inf, both
in the library and the front end.

Related, of course, to PR 30512.


-- 
           Summary: minval/maxval with +/-Inf
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org
 BugsThisDependsOn: 30512


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30694


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]