[Bug fortran/30512] MAXVAL() incorrect for zero-size int arrays, and for -HUGE-1 maximum values.
fxcoudert at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Jan 22 07:56:00 GMT 2007
------- 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
More information about the Gcc-bugs
mailing list