From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29191 invoked by alias); 22 Jan 2007 07:56:25 -0000 Received: (qmail 29140 invoked by uid 48); 22 Jan 2007 07:56:15 -0000 Date: Mon, 22 Jan 2007 07:56:00 -0000 Message-ID: <20070122075615.29139.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/30512] MAXVAL() incorrect for zero-size int arrays, and for -HUGE-1 maximum values. In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "fxcoudert at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-01/txt/msg01799.txt.bz2 ------- Comment #3 from fxcoudert at gcc dot gnu dot org 2007-01-22 07:56 ------- I don't think it's a bug, since "the negative number with the largest magnitude possible within the representation" is not -huge()-1, but -huge(). If I understand the standard correctly, -huge()-1, although being representible by the hardware you have, is not "within the representation" of this integer kind, because the range of the representation of an integer kind is supposed to be symmetric. For what it's worth, the Intel and Sun compilers have the behaviour you expect, but the Portland compiler and g95 both have the same behaviour as gfortran. Steve might have an idea on that, IIRC he's the one who implemented the -frange-check option. Otherwise, a question to comp.lang.fortran would be a good thing. -- fxcoudert at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fxcoudert at gcc dot gnu dot | |org, kargl at gcc dot gnu | |dot org Status|NEW |SUSPENDED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30512