This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: (PDP-10) Word addressed pointer arithmetic
- To: lars at nocrew dot org (Lars Brinkhoff)
- Subject: Re: (PDP-10) Word addressed pointer arithmetic
- From: Joern Rennecke <amylaar at cambridge dot redhat dot com>
- Date: Wed, 11 Apr 2001 22:57:53 +0100 (BST)
- Cc: gcc at gcc dot gnu dot org
> My current approach to pointer arithmetic is to define Pmode as
> PSImode and emit RTL insns for pointer arithmetic in addpsi3 etc.
> Unfortunately, the operands passed to the PSImode patterns does not
> carry enough information. For example, incrementing a pointer is done
> differently if it's a word address or if it's a pointer to a byte
> within a word.
>
> To work around this, I store the tree type information for each
> register (in struct emit_status). This works (to some extent) but
> seems like a kludge and a violation of GCC's design.
>
> If the tree type information is needed for code generation, perhaps
> tree-based approach is the right thing?
I think to handle this properly, we'd have to have different modes for
the two different kinds of pointer (word pointer vs. byte pointer.