This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Signed into overflow behavior in the security context
- From: Gabriel Paubert <paubert at iram dot es>
- To: Robert Dewar <dewar at adacore dot com>
- Cc: Paul Schlie <schlie at comcast dot net>, Paul Jarc <prj at po dot cwru dot edu>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Tue, 30 Jan 2007 17:41:55 +0100
- Subject: Re: Signed into overflow behavior in the security context
- References: <C1E49DF7.FB73%schlie@comcast.net> <45BF68EE.9040700@adacore.com>
On Tue, Jan 30, 2007 at 10:49:02AM -0500, Robert Dewar wrote:
> Paul Schlie wrote:
>
> >- as trap representation within the context of C is a value
> >representation which is not defined to be a member of a type, where if
> >accessed or produced evokes undefined behavior; so admit as to the best of
> >my knowledge all potentially enclosable values for IEEE floats and doubles
> >are defined, it would seem trap representations don't exist in typical fp
> >implementations, as such an implementation would require more bits of
> >encoding than the type itself requires.
>
> You don't think a signalling NaN is a trap value?
I do.
> The existence of
> such values (which do indeed cause a trap if loaded),
If loaded? This is a very approximate description.
For all architectures I use, it is rather "if used as an operand
of an arithmetic instruction", but the values can be copied
around without ever generating a trap. Even negating or taking
the absolute value never traps since those are not considered
"arithmetic" instructions.
And even then you have to explicitly enable the trap for invalid
operation (on systems using IEEE754), otherwise it is simply
propagated as a QNaN.
I remember that the VAX had separate instructions for moving floats
and ints (of the same size) and the only difference between them was
that move floating point instruction would trap on the "reserved
operand" value (zero exponent and sign bit set). However compilers
did not actually use the floating point move instructions (probably
for performance reasons).
Gabriel