This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH/RFC] m68k: add pc as register
Hi,
On Tue, 10 Aug 2004, Richard Henderson wrote:
> On Tue, Aug 10, 2004 at 12:40:02AM +0200, Roman Zippel wrote:
> > This is an experimental patch I'd like to get some comments on. The main
> > purpose is to add the pc as another register, so it can be used in address
> > operations.
>
> I'm not sure this is a good idea. Why wouldn't you be using pc_rtx?
pc_rtx is not a register, so that reload or regrename wouldn't recognize
it as a valid base register and would do the wrong thing with e.g. (plus
(plus (pc) (reg %d0)) (label)). pc_rtx would require special casing
everywhere. pc_rtx and the pc register are used in completely different
contexts, which don't overlap, so it wouldn't be of any advantage to use
only pc_rtx.
The pc register can be used like a normal base register on m68k, the only
exception is that it always has to be used with a label or symbol as
offset, separating them would create an invalid address, so generic code
shouldn't be able to separate them.
> You'll want an m68k-specific dst_nonimmediate_operand predicate.
I expected that. :)
bye, Roman