The R8C has a 20-bit addressing mode for data outside its normal
addressing range.  However, gcc *really* wants to CSE these and put
their addresses in registers, which is not going to work (pointers are
16 bit, these addresses are 20 bit).  How can I force gcc to use [sym]
or [sym+reg] addressing, and not copy &sym to a register?

Alternately, can we fix the "gcc assumes all pointers are the same
size" assumption?  Specifically this code hurts m32c:

rtx
memory_address (enum machine_mode mode, rtx x)
{
  rtx oldx = x;

  x = convert_memory_address (Pmode, x);

  /* By passing constant addresses through registers
     we get a chance to cse them.  */
  if (! cse_not_expected && CONSTANT_P (x) && CONSTANT_ADDRESS_P (x))
    x = force_reg (Pmode, x);


1. It discards the actual pointer mode and substitutes Pmode, whether
   it's valid or not, and

2. It forces the address into a register whether it's valid or not.

Reply via email to