Re: Integers and standard
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Mon, 28 Jul 2008 18:50:51 -0800
Steven G. Kargl wrote:
(snip)
Do you really want a compiler to automatically instrument the
following code to catch overflow
function add(i,j)
integer add
integer, intent(in) :: i, j
add = i + j
end function add
where add() may be called several hundered trillion times?
If you want this capability, send a bug report requesting
an option similar to -ffpe-trap, which is used with floating
point exceptions.
The PL/I way (not that I am suggesting Fortran implement
it) is to allow one to specify at the procedure level or
statement level (overriding the procedure level) to enable
or disable such checks.
(fixedoverflow): add = i + j; /* enable overflow check */
(nozerodivide): q=i/j; /* disable divide by zero check */
For IA32, overflow check adds an INTO instruction after each
that could overflow.
-- glen
.
- References:
- Integers and standard
- From: Alfredo Buttari
- Re: Integers and standard
- From: Richard Maine
- Re: Integers and standard
- From: glen herrmannsfeldt
- Re: Integers and standard
- From: Steven G. Kargl
- Re: Integers and standard
- From: James Giles
- Re: Integers and standard
- From: Steven G. Kargl
- Integers and standard
- Prev by Date: Re: Integers and standard
- Next by Date: Re: Integers and standard
- Previous by thread: Re: Integers and standard
- Next by thread: Re: Integers and standard
- Index(es):