This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about rtx format for insn, call_insn and junp_insn
- From: Ian Lance Taylor <iant at google dot com>
- To: kito <npickito at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 19 May 2010 19:52:14 -0700
- Subject: Re: Question about rtx format for insn, call_insn and junp_insn
- References: <AANLkTinX3uqqF_QBKvpGH96t6_MNUtWf1cv9mnzjgH9M@mail.gmail.com>
kito <npickito@gmail.com> writes:
> Hello every body
> I have read the rtl.h & rtl.c,
> but I don't realize the format forÂÂinsn, call_insnÂand junp_insn
>
> it's define in rtl.def
>
> DEF_RTL_EXPR(JUMP_INSN, "jump_insn", "iuuBieie0", RTX_INSN)
>
> and it's dump by some real program
>
> (jump_insn 14 Â/* Âi */
> ÂÂ Â Â Â Â 13 Â Â Â Â /* Âu */
> ÂÂ Â Â Â Â 15 Â Â Â Â /* u Â*/
> ÂÂ Â Â Â Â 1 Â Â Â Â Â /* B */
> ÂÂ Â Â Â Â (set (pc)
> ÂÂ Â Â Â Â Â Â Â(if_then_else (le (reg:CCGC 17 flags)
> ÂÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â(const_int 0 [0x0]))
> ÂÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â(label_ref 24)
> ÂÂ Â Â Â Â Â Â Â Â Â Â Â Â Â Â(pc))) Â Â Â Â Â Â Â Â Â Â Â Â/* Â e?? */
> ÂÂ Â Â Â Â-1 Â Â /* i? */
> ÂÂ Â Â Â Â(nil) Â/* e? Â*/
> ÂÂ Â Â Â Â(nil) Â/* 0? */ )
>
> so my question is where is the i after B ??
Which program is doing the dump? The generator programs (genattrtab,
etc.) produce different dumps from the compilers.
The 'i' after the 'B' represents an insn locator, a value of type
source_location aka location_t aka unsigned int. A generator program
will never print that value. A compiler will print it only if it has
a value--if the instruction has a known location. It will be printed
as filename:lineno when available.
The corresponding code in print-rtl.c is:
case 'i':
if (i == 4 && INSN_P (in_rtx))
{
#ifndef GENERATOR_FILE
/* Pretty-print insn locators. Ignore scoping as it is mostly
redundant with line number information and do not print anything
when there is no location information available. */
if (INSN_LOCATOR (in_rtx) && insn_file (in_rtx))
fprintf(outfile, " %s:%i", insn_file (in_rtx), insn_line (in_rtx));
#endif
Ian