This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR fortran/62245 fix INT docs.
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: VandeVondele Joost <joost dot vandevondele at mat dot ethz dot ch>
- Cc: Gerald Pfeifer <gerald at pfeifer dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Sun, 24 Aug 2014 09:56:43 -0700
- Subject: Re: [PATCH] PR fortran/62245 fix INT docs.
- Authentication-results: sourceware.org; auth=none
- References: <908103EDB4893A42920B21D3568BFD9312F37DC4 at MBX23 dot d dot ethz dot ch> <alpine dot LSU dot 2 dot 11 dot 1408241443070 dot 3274 at tuna dot site> <908103EDB4893A42920B21D3568BFD9312F3ADDE at MBX23 dot d dot ethz dot ch> <20140824154913 dot GA46132 at troutmask dot apl dot washington dot edu> <908103EDB4893A42920B21D3568BFD9312F3BE97 at MBX23 dot d dot ethz dot ch>
On Sun, Aug 24, 2014 at 03:58:42PM +0000, VandeVondele Joost wrote:
> >> +of @var{A} and whose sign is the same as the sign of @var{A}. The result
> >> +is undefined if it can not be represented as an @code{INTEGER} of the
> >> +given @code{KIND}.
> >
> >The last sentence above is not needed.
>
> but helpful for gfortran users ?
>
The problem is that a similar sentence would then need to be
added to other intrinsic subroutines/functions where an actual
argument might produce a result that is out-of-range of the
representable entity. Note, that it isn't limited to just
the conversion functions. Consider IABS() and the asymetric
range of the INTEGERi type.
integer i
i = - huge(i) - 1
print *, iabs(i)
end
> > There is a general
> > prohibition in 13.7.1 against calling INT(A) with |A| > HUGE(1_4).
>
> maybe you could prepare a patch to add something like that to the
> section on intrinsics?
Sure, I'll come up with a statement to be added to Sec. 8.1 of
the gfortran manual.
--
Steve