This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to get attribute of callee


Thank you for your reply,

As I know, operand 0 of call is the address of called function;
operand 1 is the number of arguments; operand 2 is the number of args
as registers. Therefore, where is the info passed to call ??? As I
would like to change the target instruction of call based on the
attribute of the called function, I need the info passed to call
pattern name.

Could you please explain more about your idea.

Phung

On Thu, Sep 2, 2010 at 7:49 PM, Georg Lay <avr@gjlay.de> wrote:
> Phung Nguyen schrieb:
>> Dear all,
>>
>> I am porting GCC to a new target. I don't know how to get attribute of
>> callee of a call.
>>
>> I defined a new attribute to assign to a function but when writing for
>> pattern name "call" or "call_value", I don't know how to know if the
>> callee is assigned the attribute. ?As the code for the call depends on
>> the attribute of the callee, I need to get the corresponding function
>> decl tree. As the operand of "call" or "call_value" might be
>> SYMBOL_REF (direct call) or REG (indirect call), I don't know how to
>> get the function declaration (fndecl).
>>
>> Could you please advise me a solution for it? I highly appreciate your help.
>
> Try this:
>
> -- Store that info in the CUMULATIVE_ARGS object
> -- Pass the info in a "call cookie" as last argument of
> ? the function like this: FUNCTION_ARG resp. FUNCTION_ARG_ADVANCE
> ? get called with mode=VOIDmode. Return a CONST_INT and evaluate
> ? the respective operand of call insn resp. call_calue insn.
>
>
>
>
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]