This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/62245] gfortran miscompiles int() on mips


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".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]