This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Pointer arithmetic: extending mark_reg_pointer?


Hello,

Defining Pmode as PSImode seems to work quite well for a back end that
wants to be able to use different instructions for pointer arithmetic
than for integer arithmetic.

However, there's no way for the back end to tell which kind of data
the pointers are pointing to.  This is required for word-addressed
machines that have different pointer formats for pointers to words and
pointers to bytes and shorts.

I see that there is a function called mark_reg_pointer defined in
emit-rtl.c.  This function is used in many places in GCC to record
that a register is a pointer, and what known alignment the pointer
has.  If tree type information was also recorded, back ends could use
this information to decide which pointer format a register has.

I have extended mark_reg_pointer in this way, and it seems to work
well most of the time.  Is it reasonable to do this, or is it a dead
end?

One problem with this is that the tree type isn't always available
when mark_reg_pointer is called.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]