Abstracting pointer arithmetic

Michael Meissner meissner@cygnus.com
Mon Jan 29 09:47:00 GMT 2001


On Mon, Jan 29, 2001 at 08:58:44AM -0500, Richard Kenner wrote:
>     So with the clarification that my suggestion was only to apply for
>     machines with exotic pointer aritmetic (say, #define EXOTIC_POINTERS
>     in the target description), was my suggestion reasonable?
> 
> You don't need that #define since the Pmode define should be good enough.

No.  Consider a 'typical' word pointer machine.  If the pointer is a pointer to
an integer aligned type (and aligning all struct/unions to meet the requirement
that all struct/union pointers have the same size/format), you might want Pmode
to translate into PSImode, but if the pointer is a pointer to a short or byte,
it gets translated into PDImode.  You really need a macro that takes the
pointer tree type and gives the appropriate type.

>     Or would something at the tree level still make more sense?
> 
> I don't think it would be enough due to reload issues and there's
> *probably* no point in doing it at both levels.

-- 
Michael Meissner, Red Hat, Inc.  (GCC group)
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482


More information about the Gcc mailing list