This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/62245] gfortran miscompiles int() on mips
- From: "kargl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 24 Aug 2014 15:21:43 +0000
- Subject: [Bug fortran/62245] gfortran miscompiles int() on mips
- Auto-submitted: auto-generated
- References: <bug-62245-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62245
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #11 from kargl at gcc dot gnu.org ---
(In reply to Julian Taylor from comment #7)
> But the docs indicate that there is no undefined behavior.
> As I interpret them the result of int() is always well defined.
> If the documentation would not state what happens in the case of overflow it
> would be fine to not mention it, but as is one has to know the standard to
> know that this part of the documentation is wrong.
The standard states (13.7.1)
A program is prohibited from invoking an intrinsic procedure
under circumstances where a value to be returned in a subroutine
argument or function result is outside the range of values
representable by objects of the specified type and type parameters,
unless the intrinsic module IEEE ARITHMETIC (clause 14) is
accessible and there is support for an infnite or a NaN
result, as appropriate.
a = +-1e99 is outside of the representable range of INTEGER,
so by calling INT(a), your program is nonconforming. gfortran
can do anything and the result is "valid".