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: 20 Jan 2007 09:37:56 -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 #1 from burnus at gcc dot gnu dot org 2007-01-20 09:37 -------
Vaguely related is:
trans-intrinsic.c's gfc_conv_intrinsic_minmaxval, which contains currently:
/* Most negative(-HUGE) for maxval, most positive (-HUGE) for minval. */
if (op == GT_EXPR)
tmp = fold_build1 (NEGATE_EXPR, TREE_TYPE (tmp), tmp);
Which has a broken comment and also the -HUGE vs -HUGE-1 problem (for
BT_INTEGER only).
Regarding the library, m4/iparm.m4 contains:
define(atype_max, atype_name`_HUGE')dnl
define(atype_min, `-'atype_max)dnl
Subtracting one from atype_min is the correct thing to do for BT_INTEGER, but
not for BT_REAL.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-01-20 09:37:56
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30512