On Sun, Nov 06, 2011 at 03:48:16PM -0500, Joern Rennecke wrote:
> >Or keep HARD_REG_SET type as is and just use a new struct type which
> >contains HARD_REG_SET or HARD_REG_SET * in it.
> >struct hard_reg_set_ptr;
> >void (*live_on_entry) (struct hard_reg_set_ptr *);
> >in the target* headers and
> >struct hard_reg_set_ptr { HARD_REG_SET *set; };
> 
> All these variants don't address the the interface problem we's get in
> the target hooks.  A type used in a target hook should be compatible
> with all targets simultaneously.
> A long * or a void * would be OK, but if you point to a HARD_REG_SET
> or something containing it, you have to consider the one-definition
> rule when it eventally comes to linking/and or loading multiple or
> alternative backends into the compiler.

The middle-end uses HARD_REG_SET in lots of places, so supposedly
when you want to support more than one target, you need to ensure
that hard-reg-set.h header won't use FIRST_PSEUDO_REGISTER of one randomly
selected target you want to support, but instead somehow computed
MAX_FIRST_PSEUDO_REGISTER which is a maximum of FIRST_PSEUDO_REGISTER
values for all targets you want to support.
In fact perhaps all uses of FIRST_PSEUDO_REGISTER in the middle-end
should be that value.

        Jakub

Reply via email to