How to force gcc to long-call a function (on MIPS)?

Andrew Haley aph@redhat.com
Thu Feb 21 10:53:00 GMT 2008


PRC wrote:
> Here is my code
> 
> --------------------------------------------------
> typedef int (*MY_FUNC_ENTRY)(int) __attribute__(( far ));
> ...
> ((MY_FUNC_ENTRY)func_entry)(para);
> ---------------------------------------------------
> 
> But gcc still generates 'jal ADDR' instead of 'jalr $reg' for this function call.
> How to force gcc to generate 'jalr' for this call?

gcc can see that the cast doesn't do anything and so
deletes it.  Does `-mlong-calls' solve your problem?

What happens when you declare `func_entry' with __attribute__(( far )) ?

Andrew.



More information about the Gcc-help mailing list