This is the mail archive of the
mailing list for the GCC project.
Re: What are the functions that i can use?
- From: Ian Lance Taylor <iant at google dot com>
- To: "Mohamed Shafi" <shafitvm at gmail dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Sun, 20 Jul 2008 22:38:55 -0700
- Subject: Re: What are the functions that i can use?
- References: <firstname.lastname@example.org>
"Mohamed Shafi" <email@example.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
> 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.