This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
(PDP-10) Word addressed pointer arithmetic
- To: gcc at gcc dot gnu dot org
- Subject: (PDP-10) Word addressed pointer arithmetic
- From: Lars Brinkhoff <lars at nocrew dot org>
- Date: 11 Apr 2001 15:43:27 +0200
- Organization: nocrew
Hello,
I've been working on the PDP-10 port. It works quite well, except for
some problems with pointers and pointer arithmetic. This is what I
expected, since the PDP-10 is a word-addressed machine with a peculiar
format for pointers to objects smaller than a word.
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?
Any advice would be very welcome.