public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/52428] New: [RFC] I/O: READING of "-huge()-1": Integer overflow
@ 2012-02-29  8:13 burnus at gcc dot gnu.org
  2012-02-29  9:09 ` [Bug fortran/52428] " burnus at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-02-29  8:13 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52428
           Summary: [RFC] I/O: READING of "-huge()-1": Integer overflow
    Classification: Unclassified
           Product: gcc
           Version: unknown
               URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=65825
                    1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
                CC: jvdelisle@gcc.gnu.org


As reported at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=658251

For I/O, reading an integer with value -huge()-1 gives an overflow error.

While that is acceptable based on the Fortran numerical model (cf. Fortran
2008, "13.4 Numeric models"), where the valid integer numbers stretch from
-huge() to huge(), it is rather irritating that one can write (WRITE, PRINT)
those numbers but not READ them back in.

Except for Fortran's numerical model, the number looks valid to me as the sign
belongs to the number and is not an unary operator applied afterwards. For
integer I/O, one reads a "signed-digit-string" (R409).


For the source code, something similar applies: Also there, one does *not* have
an unary minus operator applied to the positive string literal but:
  R406  signed-int-literal-constant  is  [ sign ] int-literal-constant
Only Fortran's numerical model is violated. Contrary to I/O, a error is
printed, which can be overruled using -fno-range-check (and that flag is often
but not always mentioned).

EXPECTED: Be more generous at run time and allow this number for integer input.


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

end of thread, other threads:[~2012-05-14 19:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-29  8:13 [Bug fortran/52428] New: [RFC] I/O: READING of "-huge()-1": Integer overflow burnus at gcc dot gnu.org
2012-02-29  9:09 ` [Bug fortran/52428] " burnus at gcc dot gnu.org
2012-04-24  6:37 ` jb at gcc dot gnu.org
2012-04-24  9:17 ` jb at gcc dot gnu.org
2012-04-24 11:17 ` jb at gcc dot gnu.org
2012-04-24 21:44 ` jb at gcc dot gnu.org
2012-04-25  0:29 ` jvdelisle at gcc dot gnu.org
2012-04-25  6:12 ` jb at gcc dot gnu.org
2012-04-25 21:16 ` jb at gcc dot gnu.org
2012-05-14 19:43 ` jb at gcc dot gnu.org
2012-05-14 19:50 ` jb 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).