public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/24685]  New: real(10) formatted input is broken for huge values
@ 2005-11-05 19:34 jblomqvi at cc dot hut dot fi
  2005-11-05 23:24 ` [Bug libfortran/24685] " fxcoudert at gcc dot gnu dot org
                   ` (37 more replies)
  0 siblings, 38 replies; 40+ messages in thread
From: jblomqvi at cc dot hut dot fi @ 2005-11-05 19:34 UTC (permalink / raw)
  To: gcc-bugs

Seems that the parsing routines cannot deal with big values:

! { dg-do run }
! { dg-require-effective-target fortran_large_real }
program huge_real10_formatted
  ! This should be kind=10 on systems that support it
  integer, parameter :: k = selected_real_kind (precision (0.0_8) + 1)
  real(kind=k) :: a,b(2), c
  character(len=180) :: tmp
  ! Test real(k) scalar and array formatted IO with big value
  b(:) = huge (1.0_k)/2
  print *, 'real(10) big value: ', b(1)
  write (tmp, *) b
  read (tmp, *) a, c
  print *, 'same value read again: ', a
  print *, 'difference: ', a-b(1)
  ! Test with really big value
  b(:) = huge (1.0_k)
  print *, 'huge value: ', b(1)
  write (tmp, *) b
  read (tmp, *) a, c ! This is line 19
  print *, "We don't get this far!"
  if (a /= b(1)) call abort ()
  if (c /= b(2)) call abort ()
end program huge_real10_formatted

Running this produces:

 real(10) big value:   5.948657476786159E+4931
 same value read again:   5.948657476786159E+4931
 difference:   1.751052108159553E+4915
 huge value:   1.189731495357232E+4932
At line 19 of file huge_real10_formatted.f90
Fortran runtime error: Range error during floating point read

Looking at the difference, there also seems to be some problem with
arithmetic..


-- 
           Summary: real(10) formatted input is broken for huge values
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jblomqvi at cc dot hut dot fi
  GCC host triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2008-12-19 18:23 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-05 19:34 [Bug libfortran/24685] New: real(10) formatted input is broken for huge values jblomqvi at cc dot hut dot fi
2005-11-05 23:24 ` [Bug libfortran/24685] " fxcoudert at gcc dot gnu dot org
2006-02-05 22:20 ` [Bug libfortran/24685] [4.1 only] " fxcoudert at gcc dot gnu dot org
2006-02-05 23:04 ` fxcoudert at gcc dot gnu dot org
2006-02-14 15:48 ` fxcoudert at gcc dot gnu dot org
2006-02-14 15:50 ` fxcoudert at gcc dot gnu dot org
2006-02-16 10:55 ` ebotcazou at gcc dot gnu dot org
2006-02-16 11:12 ` [Bug libfortran/24685] real(16) " fxcoudert at gcc dot gnu dot org
2006-02-16 17:44 ` pinskia at gcc dot gnu dot org
2006-02-23 17:44 ` sje at cup dot hp dot com
2006-03-15  7:29 ` ebotcazou at gcc dot gnu dot org
2006-03-15 16:22 ` jb at gcc dot gnu dot org
2006-03-15 16:44 ` sje at cup dot hp dot com
2006-03-16  8:30 ` jb at gcc dot gnu dot org
2006-04-01 21:34 ` ebotcazou at gcc dot gnu dot org
2006-04-01 21:35 ` ebotcazou at gcc dot gnu dot org
2006-04-10 12:03 ` jakub at gcc dot gnu dot org
2006-04-21 17:04 ` jakub at gcc dot gnu dot org
2006-04-21 17:22 ` jakub at gcc dot gnu dot org
2006-05-24 18:58 ` fxcoudert at gcc dot gnu dot org
2006-05-24 19:01   ` Andrew Pinski
2006-05-24 19:01 ` pinskia at physics dot uc dot edu
2006-05-24 20:35 ` fxcoudert at gcc dot gnu dot org
2007-05-25 19:50 ` jvdelisle at gcc dot gnu dot org
2007-05-26 17:51 ` dominiq at lps dot ens dot fr
2007-11-03 16:48 ` jvdelisle at gcc dot gnu dot org
2007-11-12  5:44 ` jvdelisle at gcc dot gnu dot org
2008-01-17 11:24 ` [Bug libfortran/24685] real(16) formatted input is broken for huge values (gfortran.dg/default_format_2.f90) burnus at gcc dot gnu dot org
2008-01-17 15:33 ` ebotcazou at gcc dot gnu dot org
2008-01-24 15:09 ` dominiq at lps dot ens dot fr
2008-01-25 15:47 ` dominiq at lps dot ens dot fr
2008-02-23 20:11 ` fxcoudert at gcc dot gnu dot org
2008-02-23 20:11 ` fxcoudert at gcc dot gnu dot org
2008-02-28  7:10 ` uros at gcc dot gnu dot org
2008-12-12 22:20 ` janis at gcc dot gnu dot org
2008-12-12 22:23 ` janis at gcc dot gnu dot org
2008-12-19  1:39 ` howarth at nitro dot med dot uc dot edu
2008-12-19 17:51 ` janis at gcc dot gnu dot org
2008-12-19 18:15 ` janis at gcc dot gnu dot org
2008-12-19 18:23 ` janis at gcc dot gnu dot 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).