public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/18597] New: numerical constant arithmetic overflow with integer(kind=4)
@ 2004-11-21 15:58 paul dot richard dot thomas at cea dot fr
  2004-11-21 16:19 ` [Bug fortran/18597] " pinskia at gcc dot gnu dot org
  2004-11-21 16:29 ` paulthomas2 at wanadoo dot fr
  0 siblings, 2 replies; 3+ messages in thread
From: paul dot richard dot thomas at cea dot fr @ 2004-11-21 15:58 UTC (permalink / raw)
  To: gcc-bugs

This error was encountered in building the NetCDF fortran90 test programme 
with gfortran.

Numerical constants appear to be integer*4 and the +ve and -ve limits are 
fixed to the same magnitude.

PROGRAM test_min
INTEGER(KIND=4),PARAMETER :: ikind=0
integer(kind=4)  :: itest = -HUGE(ikind)-1
print *,-itest
print *,itest-1
END PROGRAM test_min

produces

$ /gcc-4.0/bin/gfortran -O3  test_min.f90
 In file test_min.f90:3

integer(kind=4)  :: itest = -HUGE(ikind)-1PROGRAM test_min
INTEGER(KIND=4),PARAMETER :: ikind=0
integer(kind=4)  :: itest = -HUGE(ikind)    !!!-1 removed
print *,-itest
print *,itest-1
END PROGRAM test_min

                                1
Error: Arithmetic overflow at (1)

whilst


correctly produces

$ ./a
  2147483647
 -2147483648

-- 
           Summary: numerical constant arithmetic overflow with
                    integer(kind=4)
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: paul dot richard dot thomas at cea dot fr
                CC: gcc-bugs at gcc dot gnu dot org,paulthomas2 at wanadoo
                    dot fr


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


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

* [Bug fortran/18597] numerical constant arithmetic overflow with integer(kind=4)
  2004-11-21 15:58 [Bug fortran/18597] New: numerical constant arithmetic overflow with integer(kind=4) paul dot richard dot thomas at cea dot fr
@ 2004-11-21 16:19 ` pinskia at gcc dot gnu dot org
  2004-11-21 16:29 ` paulthomas2 at wanadoo dot fr
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-21 16:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-21 16:19 -------


*** This bug has been marked as a duplicate of 17912 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug fortran/18597] numerical constant arithmetic overflow with integer(kind=4)
  2004-11-21 15:58 [Bug fortran/18597] New: numerical constant arithmetic overflow with integer(kind=4) paul dot richard dot thomas at cea dot fr
  2004-11-21 16:19 ` [Bug fortran/18597] " pinskia at gcc dot gnu dot org
@ 2004-11-21 16:29 ` paulthomas2 at wanadoo dot fr
  1 sibling, 0 replies; 3+ messages in thread
From: paulthomas2 at wanadoo dot fr @ 2004-11-21 16:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From paulthomas2 at wanadoo dot fr  2004-11-21 16:29 -------
Subject: Re:  numerical constant arithmetic overflow with integer(kind=4)

> *** This bug has been marked as a duplicate of 17912 ***
> 
agreed



-- 


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


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

end of thread, other threads:[~2004-11-21 16:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-21 15:58 [Bug fortran/18597] New: numerical constant arithmetic overflow with integer(kind=4) paul dot richard dot thomas at cea dot fr
2004-11-21 16:19 ` [Bug fortran/18597] " pinskia at gcc dot gnu dot org
2004-11-21 16:29 ` paulthomas2 at wanadoo dot fr

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).