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: "fxcoudert 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 07:56:15 -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 #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