From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20891 invoked by alias); 22 Jan 2007 08:47:41 -0000 Received: (qmail 20841 invoked by uid 48); 22 Jan 2007 08:47:31 -0000 Date: Mon, 22 Jan 2007 08:47:00 -0000 Message-ID: <20070122084731.20840.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: "burnus 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/msg01802.txt.bz2 ------- Comment #4 from burnus at gcc dot gnu dot org 2007-01-22 08:47 ------- > 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. NAG f95 and pathscale 2.4 have: -128. > 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. Might be, but on the otherhand, if I have the following program: integer(1) :: a(2) a = -128 print *, maxval(a) I would expect that it prints "-128" and not "-127". -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30512