Robert Dewar write: >Usually there are ways of telling what is going on at a sufficiently >low level, but in any case, code using the conditional jump instruction >(jo/jno) is hugely better than what we do now (and it is often faster >to usea jo than into).
Ross Ridge wrote: >My point is that using INTO or some other processor's overlow mechanism >that requires operating system support wouldn't necessarily be better for >Ada, even it performs better (or uses less space) than the alternatives. >Having the program crash with a vague exception would meet the >requirements of -ftrapv, but not Ada. Robert Dewar write: >But, once again, using the processor specific JO instruction will be >much better for Ada than double length arithmetic, using JO does not >involve a "program crash with a vague exception". *sigh* The possibility of using GCC's -ftrapv support to implement overlow exceptions in Ada was mentioned in this thread. There's no requirement that -ftrapv do anything other than crash when overflow occurs. A -ftrapv that did everything you've said you wanted, performed faster and caught 100% of overflows 100% reliabily wouldn't necessarily be better for Ada. On the 32-bit IA-32 platform, either the JO instruction or a INTO instruction could legitimately be used to provide a more optimal implementation of -ftrapv. Even the JO instruction could do nothing more than jump to abort(). Ross Ridge