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

--- Comment #1 from Gerhard Steinmetz <gerhard.steinmetz.fort...@t-online.de> 
---
Of course, some computations are wrong, too.

For example :

   program p
      integer(8), parameter :: z = huge(1_8)
      print *, 2_16 * z
      print *, 2 * int(z, 16)
      print *, 2_16 * int(z, 16)
      print *, int(2, 16) * int(z, 16)
   end


Result with gfortran 5.1.1 :

 -2
 -2
 -2
 -2

Result with gfortran 4.9.0 and 4.8.3 :

 18446744073709551614
 18446744073709551614
 18446744073709551614
 18446744073709551614


---

Or this variation :

   program p
      integer(16), parameter :: z = huge(1_8)
      print *, 2_16 * z
      print *, 2 * int(z, 16)
      print *, 2_16 * int(z, 16)
      print *, int(2, 16) * int(z, 16)
   end

Result with gfortran 5.1.1 :

 -2
 -2
 -2
 -2

Result with gfortran 4.9.0 and 4.8.3 :

 18446744073709551614
 18446744073709551614
 18446744073709551614
 18446744073709551614

Reply via email to