This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][4.3] Deprecate -ftrapv
- From: Robert Dewar <dewar at adacore dot com>
- To: Ross Ridge <rridge at csclub dot uwaterloo dot ca>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 02 Mar 2008 16:38:20 -0500
- Subject: Re: [PATCH][4.3] Deprecate -ftrapv
- References: <20080302213049.D70EF73D8C@caffeine.csclub.uwaterloo.ca>
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().
Yes, and that is what we would want for Ada, so I am puzzled by your
sigh. All Ada needs to do is to issue a constraint_error exception,
it does not need to know where the exception came from or why except
in very broad detail.
there is some miscommmunication here, and I can't figure out what it is!