On Jan 31, 2008 8:40 PM, DJ Delorie <[EMAIL PROTECTED]> wrote:
>
> > The problem you are running into is that sizeof(sizetype) !=
> > sizeof(void *).  In the middle-end the type used as offset
> > (sizetype) doesn't have a defined signedness (it's unsigned for C,
> > signed for Ada for example), so we rely on the fact that its size
> > should match that of pointers (as then we don't need to worry about
> > sign or zero extension).
>
> That kind of assumption just isn't going to work for m32c, because
> there aren't enough pointer-sized operators to satisfy gcc, so pointer
> math has to be done in a smaller mode.  Doing it in a larger mode is
> way too slow (all emulated math).
>
> So... now what?

There are two parts of the problem.  One is the tree representation of
pointer offsets (it uses sizetype) and one is how this is expanded to RTL.
The fix probably lies at expansion (at least for 4.3) - even though we
might want to change the use of sizetype to some other type in 4.4.

Can you represent all pointer offsets (well, those you actually support)
within sizetype?  If so you probably only need to adjust expansion
of POINTER_PLUS_EXPR.

Richard.

Reply via email to