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: 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


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