This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to use a scratch register in "jump" pattern ?
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Stelian Pop <stelian at popies dot net>
- Cc: gcc at gnu dot org
- Date: Tue, 10 Mar 2009 17:20:28 +0000
- Subject: Re: How to use a scratch register in "jump" pattern ?
- References: <20090310164519.GB12702@galileo>
Stelian Pop wrote:
> I need to use a scratch register in the "jump" pattern and I can't
> figure out how to do it properly.
>
> My problem is that the microcontroller I'm porting gcc onto does not
> permit "far" jumps, those must be done using an indirect adressing.
> (define_insn "*jump"
> Any idea ?
You should be able to define/use the "indirect_jump" pattern instead? Take
a look at the last paragraph of the the docs for the "call" pattern as well.
I don't think it'll work to have a jump insn that is sometimes direct,
sometimes indirect.
Looking at how the rs6000 backend handles direct and indirect calls and
jumps might give you some inspiration too.
cheers,
DaveK