m32c support for named addr spaces branch

DJ Delorie dj@redhat.com
Fri Oct 16 23:57:00 GMT 2009


Trying to compile this:

extern char __far far_char_array[50];
void
far_array_set (int i)
{
  far_char_array[i+10] = 0;
}


How do I tell gcc which registers are legal base registers for the
__far addressing mode?  It tries $a1 and $r0, but only $a0 is allowed.

It works just fine without the "__far", and in fact chooses $a0
although $a1 *would* work then.


dj.c:76:1: error: unrecognizable insn:
(insn 19 18 13 2 dj.c:75 (set (mem/s/j:QI (plus:SI (reg:SI 0 r0)
                (symbol_ref:SI ("far_char_array") [flags 0x40] <var_decl 0xb8050170 far_char_array>)) [0 far_char_array S1 A8 AS1])
        (reg:QI 2 r1)) -1 (nil))


This is the pattern I want, aside from the use of $a1:

(mem/s/j:QI (plus:SI (zero_extend:SI (plus:HI (reg/v:HI 5 a1 [orig:26 i ] [26])
                (const_int 10 [0xa])))
        (symbol_ref:SI ("far_char_array") [flags 0x40] <var_decl 0xb8050170 far_char_array>)) [0 far_char_array S1 A8 AS1])



More information about the Gcc-patches mailing list