How to force an indirect jump?

Joern Rennecke amylaar@spamcop.net
Fri Jul 8 20:33:00 GMT 2011


Quoting Richard Henderson <rth@redhat.com>:

> On 07/07/2011 06:48 AM, Camo Johnson wrote:
>> Somehow I was not able to find a way to do so. The main problem is
>> that I can't find a way to tell the compiler that I need a register
>> for the indirect jump.
>
> Have a look at the SH target, which has a very similar problem.

A caveat, though: this is a port that used to be highly tuned for
performance, but hasn't seen much TLC recently.
The code that makes use of the bsr instruction for sh-elf relies on
relocation output with -mrelax (some of which was broken the last time
I looked), but is actually located in is in bfd/elf32-sh.c, and the design
is explained in bfd/coff-sh.c .

I suppose a new port would be expected to do this inside gcc with lto,
with some yet to be created/contributed infrastructure for inter-function
branch shortening.



More information about the Gcc mailing list