public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/17912] New: gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77
@ 2004-10-09 16:19 anlauf at hep dot tu-darmstadt dot de
  2004-10-09 18:37 ` [Bug fortran/17912] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: anlauf at hep dot tu-darmstadt dot de @ 2004-10-09 16:19 UTC (permalink / raw)
  To: gcc-bugs

Hi,

this code fails to compile with gfortran, but compiles with g77
(and, needless to say, other compilers ;-)

      program gfcbug16
      integer i
      i = -2147483647 - 1
      print *, i
      end

I get:

 In file gfcbug16.f:3

      i = -2147483647 - 1                                               
         1
Error: Arithmetic overflow at (1)


Note that the integer constants are perfectly legal (so this is different
from bug report #13490), but gfortran sort of "optimizes" by calculating
the difference and then complains, even if compiling with -O0 -g.

I could live with a (suppressible) warning message, but throwing an error
clearly breaks legacy code.

Cheers,
-ha

-- 
           Summary: gfortran: Bogus "Arithmetic overflow" error, regression
                    w.r.t. g77
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anlauf at hep dot tu-darmstadt dot de
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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


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

* [Bug fortran/17912] gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77
  2004-10-09 16:19 [Bug fortran/17912] New: gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77 anlauf at hep dot tu-darmstadt dot de
@ 2004-10-09 18:37 ` pinskia at gcc dot gnu dot org
  2004-10-11 16:28 ` tobi at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-09 18:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-09 18:37 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2004-10-09 18:37:37
               date|                            |


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


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

* [Bug fortran/17912] gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77
  2004-10-09 16:19 [Bug fortran/17912] New: gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77 anlauf at hep dot tu-darmstadt dot de
  2004-10-09 18:37 ` [Bug fortran/17912] " pinskia at gcc dot gnu dot org
@ 2004-10-11 16:28 ` tobi at gcc dot gnu dot org
  2004-10-19 18:54 ` coyote at coyotegulch dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-10-11 16:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-10-11 16:28 -------
This has been a topic of heated discussion in the past. See the bug I added as a
dependency and the various discussions this had spawned. I think as I always
thought that we're safe from the point of view of the standard to allow integer
ranges [-2**31, 2**31-1], and now that the dust has settled I think a patch for
this can be proposed again.

I'll cook something up these days.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |13490


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


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

* [Bug fortran/17912] gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77
  2004-10-09 16:19 [Bug fortran/17912] New: gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77 anlauf at hep dot tu-darmstadt dot de
  2004-10-09 18:37 ` [Bug fortran/17912] " pinskia at gcc dot gnu dot org
  2004-10-11 16:28 ` tobi at gcc dot gnu dot org
@ 2004-10-19 18:54 ` coyote at coyotegulch dot com
  2004-10-19 19:07 ` coyote at coyotegulch dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: coyote at coyotegulch dot com @ 2004-10-19 18:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From coyote at coyotegulch dot com  2004-10-19 18:54 -------
I've posted an update to the original "asymmetric integers" patch, but it did
not address this specific PR.


-- 


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


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

* [Bug fortran/17912] gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77
  2004-10-09 16:19 [Bug fortran/17912] New: gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77 anlauf at hep dot tu-darmstadt dot de
                   ` (2 preceding siblings ...)
  2004-10-19 18:54 ` coyote at coyotegulch dot com
@ 2004-10-19 19:07 ` coyote at coyotegulch dot com
  2004-10-22  0:07 ` coyote at coyotegulch dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: coyote at coyotegulch dot com @ 2004-10-19 19:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From coyote at coyotegulch dot com  2004-10-19 19:06 -------
Correction: My patch does fix this bug. See:

http://gcc.gnu.org/ml/gcc-patches/2004-10/msg01613.html

-- 


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


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

* [Bug fortran/17912] gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77
  2004-10-09 16:19 [Bug fortran/17912] New: gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77 anlauf at hep dot tu-darmstadt dot de
                   ` (3 preceding siblings ...)
  2004-10-19 19:07 ` coyote at coyotegulch dot com
@ 2004-10-22  0:07 ` coyote at coyotegulch dot com
  2004-10-28 21:45 ` coyote at coyotegulch dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: coyote at coyotegulch dot com @ 2004-10-22  0:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From coyote at coyotegulch dot com  2004-10-22 00:07 -------
An improved patch. See comments attached to PR13490, or the patch below:

http://gcc.gnu.org/ml/gcc-patches/2004-10/msg01876.html


-- 


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


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

* [Bug fortran/17912] gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77
  2004-10-09 16:19 [Bug fortran/17912] New: gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77 anlauf at hep dot tu-darmstadt dot de
                   ` (4 preceding siblings ...)
  2004-10-22  0:07 ` coyote at coyotegulch dot com
@ 2004-10-28 21:45 ` coyote at coyotegulch dot com
  2004-10-28 21:46 ` coyote at coyotegulch dot com
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: coyote at coyotegulch dot com @ 2004-10-28 21:45 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 17912 depends on bug 13490, which changed state.

Bug 13490 Summary: Compiler rejects valid constant -2147483648 for 32-bit int
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13490

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

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


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

* [Bug fortran/17912] gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77
  2004-10-09 16:19 [Bug fortran/17912] New: gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77 anlauf at hep dot tu-darmstadt dot de
                   ` (5 preceding siblings ...)
  2004-10-28 21:45 ` coyote at coyotegulch dot com
@ 2004-10-28 21:46 ` coyote at coyotegulch dot com
  2004-10-28 21:48 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: coyote at coyotegulch dot com @ 2004-10-28 21:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From coyote at coyotegulch dot com  2004-10-28 21:46 -------
Patch committed after approval

-- 


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


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

* [Bug fortran/17912] gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77
  2004-10-09 16:19 [Bug fortran/17912] New: gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77 anlauf at hep dot tu-darmstadt dot de
                   ` (6 preceding siblings ...)
  2004-10-28 21:46 ` coyote at coyotegulch dot com
@ 2004-10-28 21:48 ` pinskia at gcc dot gnu dot org
  2004-10-28 22:25 ` cvs-commit at gcc dot gnu dot org
  2004-11-21 16:19 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-28 21:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-28 21:48 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


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


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

* [Bug fortran/17912] gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77
  2004-10-09 16:19 [Bug fortran/17912] New: gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77 anlauf at hep dot tu-darmstadt dot de
                   ` (7 preceding siblings ...)
  2004-10-28 21:48 ` pinskia at gcc dot gnu dot org
@ 2004-10-28 22:25 ` cvs-commit at gcc dot gnu dot org
  2004-11-21 16:19 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-28 22:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-10-28 22:25 -------
Subject: Bug 17912

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	srladd@gcc.gnu.org	2004-10-28 22:25:18

Modified files:
	gcc/fortran    : ChangeLog 

Log message:
	Fix for PR fortran/13490, PR fortran/17912

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.239&r2=1.240



-- 


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


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

* [Bug fortran/17912] gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77
  2004-10-09 16:19 [Bug fortran/17912] New: gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77 anlauf at hep dot tu-darmstadt dot de
                   ` (8 preceding siblings ...)
  2004-10-28 22:25 ` cvs-commit at gcc dot gnu dot org
@ 2004-11-21 16:19 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ 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 -------
*** Bug 18597 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |paul dot richard dot thomas
                   |                            |at cea dot fr


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


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

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

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-09 16:19 [Bug fortran/17912] New: gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77 anlauf at hep dot tu-darmstadt dot de
2004-10-09 18:37 ` [Bug fortran/17912] " pinskia at gcc dot gnu dot org
2004-10-11 16:28 ` tobi at gcc dot gnu dot org
2004-10-19 18:54 ` coyote at coyotegulch dot com
2004-10-19 19:07 ` coyote at coyotegulch dot com
2004-10-22  0:07 ` coyote at coyotegulch dot com
2004-10-28 21:45 ` coyote at coyotegulch dot com
2004-10-28 21:46 ` coyote at coyotegulch dot com
2004-10-28 21:48 ` pinskia at gcc dot gnu dot org
2004-10-28 22:25 ` cvs-commit at gcc dot gnu dot org
2004-11-21 16:19 ` pinskia 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).