This is the mail archive of the gcc@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]

Re: [PATCH][4.3] Deprecate -ftrapv


Mark Mitchell writes:
> However, I don't think doing all of that work is required to make this 
> feature useful to people.  You seem to be focusing on making -ftrapv 
> capture 100% of overflows, so that people could depend on their programs 
> crashing if they had an overflow.  That might be useful in two 
> circumstances: (a) getting bugs out (though for an example like the one 
> above, I can well imagine many people not considering that a bug worth 
> fixing), and (b) in safety-critical situations where it's better to die 
> than do the wrong thing.

Richard Kenner writed:
> You forgot the third: if Ada is to use it rather than its own approach,
> it must indeed be 100% reliable.

Actually, that's a different issue than catching 100% of overflows, 
which apparently Ada doesn't require.

> Robert is correct that if it's sufficiently more efficient than Ada's
> approach, it can be made the default, so that by default range-checking
> is on in Ada, but not in a 100% reliable fashion.

On the issue of performance, out of curiosity I tried playing around
with the IA-32 INTO instruction.  I noticed two things, the first was
that instruction wasn't supported in 64-bit mode, and the second was
that it on the Linux I was using, it generated SIGSEGV signal that was
indistinguishable from any other SIGSEGV.  If Ada needs to be able to
catch and distinguish overflow exceptions, this and possibile other
cases of missing operating support might make processor specific overlow
support detrimental.

					Ross Ridge


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