public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/66311] New: [5 Regression] Problems with some integer(16) values
@ 2015-05-27 15:35 gerhard.steinmetz.fortran@t-online.de
  2015-05-28  1:48 ` [Bug fortran/66311] " jvdelisle at gcc dot gnu.org
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: gerhard.steinmetz.fortran@t-online.de @ 2015-05-27 15:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66311
           Summary: [5 Regression] Problems with some integer(16) values
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fortran@t-online.de
  Target Milestone: ---

First of all, it's great to support integer(16).

But printing some numbers from range 2^63 to 2^64-1 with this snippet :

   program p
      print *, 9000000000000000000_16
      print *, huge(1_8)
      print *, 2_16**63
      print *, 10000000000000000000_16
      print *, 18446744065119617024_16
      print *, 2_16**64 - 1
      print *, 2_16**64
      print *, 20000000000000000000_16
   end


yields a wrong output for gfortran 5.1.1 (on SUSE Linux 13.2, 64 bit)

 9000000000000000000
  9223372036854775807
 -9223372036854775808
 -8446744073709551616
 -8589934592
 -1
 18446744073709551616
 20000000000000000000


Whereas with gfortran 4.9.0 and 4.8.3 the printed numbers are correct:

 9000000000000000000
  9223372036854775807
 9223372036854775808
 10000000000000000000
 18446744065119617024
 18446744073709551615
 18446744073709551616
 20000000000000000000


---

Same issue for the corresponding negative range :

   program p
      print *, -9000000000000000000_16
      print *, -huge(1_8)
      print *, -(2_16**63)
      print *, -10000000000000000000_16
      print *, -18446744065119617024_16
      print *, -(2_16**64 - 1)
      print *, -(2_16**64)
      print *, -20000000000000000000_16
   end


Result with gfortran 5.1.1 :

 -9000000000000000000
 -9223372036854775807
 9223372036854775808
 8446744073709551616
 8589934592
 1
 -18446744073709551616
 -20000000000000000000


Result with gfortran 4.9.0 and 4.8.3 :

 -9000000000000000000
 -9223372036854775807
 -9223372036854775808
 -10000000000000000000
 -18446744065119617024
 -18446744073709551615
 -18446744073709551616
 -20000000000000000000


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

end of thread, other threads:[~2015-10-27  9:21 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-27 15:35 [Bug fortran/66311] New: [5 Regression] Problems with some integer(16) values gerhard.steinmetz.fortran@t-online.de
2015-05-28  1:48 ` [Bug fortran/66311] " jvdelisle at gcc dot gnu.org
2015-05-28  7:38 ` [Bug fortran/66311] [5/6 " rguenth at gcc dot gnu.org
2015-05-28  9:22 ` dominiq at lps dot ens.fr
2015-07-16  9:13 ` rguenth at gcc dot gnu.org
2015-07-17  0:52 ` zadeck at naturalbridge dot com
2015-08-04 10:07 ` mikael at gcc dot gnu.org
2015-08-04 11:38 ` mikael at gcc dot gnu.org
2015-08-04 17:00 ` mrs at gcc dot gnu.org
2015-08-04 17:03 ` zadeck at naturalbridge dot com
2015-08-04 17:18 ` rsandifo at gcc dot gnu.org
2015-08-04 18:31 ` fxcoudert at gcc dot gnu.org
2015-08-04 18:51 ` mikael at gcc dot gnu.org
2015-08-04 19:09 ` fxcoudert at gcc dot gnu.org
2015-08-04 20:12 ` rsandifo at gcc dot gnu.org
2015-08-05 14:24 ` rsandifo at gcc dot gnu.org
2015-08-05 14:25 ` rsandifo at gcc dot gnu.org
2015-10-16  8:32 ` rguenth at gcc dot gnu.org
2015-10-17  3:55 ` [Bug middle-end/66311] [5 " mrs at gcc dot gnu.org
2015-10-17  3:58 ` mrs at gcc dot gnu.org
2015-10-27  9:21 ` clyon 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).