Need advice on bounds checking approaches

Richard Henderson rth@cygnus.com
Tue Mar 28 01:55:00 GMT 2000


On Mon, Mar 27, 2000 at 11:07:11PM -0700, Greg McGary wrote:
> > For i386, it makes sense the use the `bound' instruction.
> 
> I should qualify that: `bound' is optimal for space, but
> it might run faster to decompose into register compares.

`bound' is a horribly slow instruction on all processors.

> Add PA, C[34]x and MIPS to that list.  Others can be simulated with
> conditional branches around unconditional traps.

Alpha has a particular sequence that's supposed to be
used to specifically report out of bounds conditions:

	ldi $16, GEN_SUBRNG
	call_pal gentrap


r~


More information about the Gcc mailing list