This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: bounds checking and traps
- From: "Jan Beulich" <JBeulich at novell dot com>
- To: <zack at codesourcery dot com>
- Cc: <gcc at gcc dot gnu dot org>,<wilson at specifixinc dot com>
- Date: Fri, 13 Aug 2004 09:15:57 +0200
- Subject: Re: bounds checking and traps
>Look for the code implementing __builtin_trap().
Hmm - I'm not sure how I managed to overlook that.
>i386.md can certainly contain OS-conditionalized code, if necessary,
>but I think the problem is with your OS - this might as well be part
>of the i386 ABI.
There is no i386 ABI. There is an i386 SystemV ABI, an i386 Windows
ABI, and a few (perhaps a lot) more. And in my eyes, the compiler isn't
supposed to prefer anyone over the others. Thus such an implementation
can be valid only if all intended to be supported ABIs match in that
respect.
And the processor documentation doesn't say anything about the meaning
on software INT 00...1F, and note that the use of any of them conflicts
with their classification (fault, trap, abort vs. interrupt) and
behavior (they all behave like traps in that the return pointer points
to the following instruction, whereas several of the exceptions -
including #BR - are faults) and for those where the corresponding
exception produces an error code would be outright wrong; the latter
combined with the idea of treating all vectors similarly prohibits their
use.
Jan