This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30512] MAXVAL() incorrect for zero-size int arrays, and for -HUGE-1 maximum values.
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jan 2007 08:47:31 -0000
- Subject: [Bug fortran/30512] MAXVAL() incorrect for zero-size int arrays, and for -HUGE-1 maximum values.
- References: <bug-30512-13350@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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