Hi Ian,

  Thanks for the reply.
  Please accept my apologize for including both the mail chains. I
will make sure not to repeat this again.



On Fri, Oct 11, 2013 at 7:32 PM, Ian Lance Taylor <i...@google.com> wrote:
> On Fri, Oct 11, 2013 at 2:48 AM, Nagaraju Mekala <gnuuser....@gmail.com> 
> wrote:
>>
>>   My question is how to find the attributes of a function which we are
>> going to call
>>
>>   Problem:
>>
>>    Generally while calling a function we use branch instruction
>>
>>    ex: br r5,<offset>
>>
>>   But when we have a function with "super" attribute then I need to
>> call the function with different branch instruction
>>
>>   ex: bk r5,<offset>
>>
>>
>> In the prologue of the function I was able to get the attribute
>> details using below code
>>
>> super_table_handler_function_p (tree func)
>> {
>>   tree a;
>>   if (TREE_CODE (func) != FUNCTION_DECL)
>>     return 0;
>>   a = lookup_attribute ("super", DECL_ATTRIBUTES (func));
>>   return a != NULL_TREE;
>> }
>>
>>
>> How to get the information of function attributes even before entering
>> to prologue or during function call itself??
>
>
> Please never send e-mail to both gcc-h...@gcc.gnu.org and
> gcc@gcc.gnu.org.  Thanks.  This message could have been sent to either
> list, but not both.
>
> To answer your question: look at how the rs6000 port handles the
> longcall attribute.
>
I observed that in rs6000 port longcall is implemented by using
CALL_LONG define.
#define CALL_LONG 0x00000008 /* always call indirect */
In the md file they are checking the operand with CALL_LONG
if (INTVAL (operands[3]) & CALL_LONG)
operands[1] = rs6000_longcall_ref (operands[1]);
In my port I dont have suchthing to compare. Can we somehow parse the
tree chain and check the attributes of the functions..
> Ian

Thanks,
Nagaraju

Reply via email to