Question about long jump implementation

Neil Hickey neil@petapath.com
Fri Dec 17 09:18:00 GMT 2010


Hi Ian, thanks for the response.

I did manage to fix it. The problem was in my call_internal
implementation. I went back and looked again at the arm implementation
and spotted what I'd done wrong.

Sorry for the bother.

On 17 December 2010 01:21, Ian Lance Taylor <iant@google.com> wrote:
> Neil Hickey <neil@petapath.com> writes:
>
>> I'm trying to implement long jump and I'm using the call instruction
>> in the arm implementation as a reference.
>>
>> The code looks like this:
>>
>>     rtx callee, pat;
>>
>>     callee = XEXP(operands[0], 0);
>>     if (GET_CODE (callee) == SYMBOL_REF
>>       ? atdsp_is_long_call_p (SYMBOL_REF_DECL (callee))
>>       : !REG_P (callee)) {
>>       XEXP(operands[0], 0) = force_reg (SImode, callee);
>>     }
>>     pat = gen_call_internal (operands[0], operands[1]);
>>     emit_call_insn(pat);
>>     DONE;
>>
>> What I want to happen is for the function name to be copied to a
>> register and then the compiler emit the instruction to call the
>> function, by jumping to the address held in that register.
>>
>> The compiler emits instructions that copy the function name to a
>> register, then it loads from the value of this register, before
>> jumping to the loaded value. What I want it to do is copy the function
>> name to the register, then jump to the address held in this register.
>>
>> Does anyone know what it is I've done wrong and how I can get this to work?
>
> I think it's impossible for us to say without more information.
>
> Does the RTL look correct?  If not, then you need to fix the RTL
> generation, which will look more or less like the code above.  If the
> RTL does look correct, then you need to fix your MD file to generate
> instructions which correctly represent the RTL.
>
> Ian
>



More information about the Gcc mailing list