From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18735 invoked by alias); 9 Oct 2004 16:19:14 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 18723 invoked by uid 48); 9 Oct 2004 16:19:13 -0000 Date: Sat, 09 Oct 2004 16:19:00 -0000 From: "anlauf at hep dot tu-darmstadt dot de" To: gcc-bugs@gcc.gnu.org Message-ID: <20041009161912.17912.anlauf@hep.tu-darmstadt.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug fortran/17912] New: gfortran: Bogus "Arithmetic overflow" error, regression w.r.t. g77 X-Bugzilla-Reason: CC X-SW-Source: 2004-10/txt/msg01203.txt.bz2 List-Id: 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