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/16289] New: Test intrinsic_nearest.f90 not portable?


test execute/intrinsic_nearest.f90 is failing on irix
Reduced test case is:

program test_nearest
  real min
  integer mini
  equivalence (min,mini)
  mini = 1
  call test_up(0, min)
end

subroutine test_up(s, e)
  real s, e, x
  integer xi
  equivalence (x,xi)
  x = nearest(s, 1.0)
  if (x .ne. e) then
    write(6,*) 's= ', s
    write(6,*) 'e= ', e
    write(6,*) 'x= ', x
    write(6,*) 'xi= ', xi   
    call abort()
  end if
end

and output from this is 

 s=    0.000000    
 e=    0.000000    
 x=   1.1754943E-38    
 xi=      8388608


Looks to me like the representation of min using the equivalence
is wrong for irix, and therefore the test is not portable.

Using the tiny() intrinsic works for me.  I will submit a patch.

-- 
           Summary: Test intrinsic_nearest.f90 not portable?
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: billingd at gcc dot gnu dot org
        ReportedBy: billingd at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: mips-sgi-irix6.5
  GCC host triplet: mips-sgi-irix6.5
GCC target triplet: mips-sgi-irix6.5


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


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