Mohamed Shafi | 19 Jul 14:33

What are the functions that i can use?

Hello all,

I am involved in porting gcc 4.1.2.
For some processing i need to know whether a register is being defined
and used in a particular instruction. Till now i have been using
'refers_to_regno_p()' to know whether a register is being used in a
instruction and 'modified_in_p()' to know whether a register is being
defined in the instruction. But 'refers_to_regno_p()' also looks into
expr_list and/or notes in an instruction. So sometimes
refers_to_regno_p() returns 1 when the register is referred in the
expr_list in the instruction even though its use list of the
instruction.

Could any one tell me the functions that i can use to find out whether
an register is being used and/or defined in a particular instruction?

Regards,
Shafi

Ian Lance Taylor | 21 Jul 07:38

Re: What are the functions that i can use?

"Mohamed Shafi" <shafitvm <at> gmail.com> writes:

> I am involved in porting gcc 4.1.2.
> For some processing i need to know whether a register is being defined
> and used in a particular instruction. Till now i have been using
> 'refers_to_regno_p()' to know whether a register is being used in a
> instruction and 'modified_in_p()' to know whether a register is being
> defined in the instruction. But 'refers_to_regno_p()' also looks into
> expr_list and/or notes in an instruction. So sometimes
> refers_to_regno_p() returns 1 when the register is referred in the
> expr_list in the instruction even though its use list of the
> instruction.
>
> Could any one tell me the functions that i can use to find out whether
> an register is being used and/or defined in a particular instruction?

Those functions are fine, but you need to call them on PATTERN (insn),
not on insn.

Note that call instructions require special handling.

Ian


Gmane