GCC源代码分析,recog_memoized()函数

Datetime:2016-08-23 03:47:21          Topic: Source Code Analysis           Share

int

recog_memoized (insn)
     rtx insn;
{
  volatile_ok = 1;
  if (INSN_CODE (insn) < 0)
    INSN_CODE (insn) = recog (PATTERN (insn), insn);
  return INSN_CODE (insn);
}

recog()函数定义在insn_recog.c文件中

...
insn insn 13
insn call_insn 140
insn insn 14
insn jump_insn 137
(const_int 4)
(reg:SI 6)
(plus:SI (reg:SI 6)
   (const_int 4))
(mem:SI (plus:SI (reg:SI 6)
       (const_int 4)))
(reg:SI 6)
(reg:SI 6)
(plus:SI (reg:SI 6)
   (reg:SI 6))
(const_int 4)
(plus:SI (plus:SI (reg:SI 6)
       (reg:SI 6))
   (const_int 4))
insn insn 13
insn call_insn 140
insn insn 14
insn jump_insn 137
(mem (nil))
insn insn 13
insn insn 13
insn call_insn 140
insn call_insn 140
insn insn 14
insn insn 14
insn jump_insn 137
insn jump_insn 137

最终得到的号码是140

static char *
output_140 (operands, insn)
     rtx *operands;
     rtx insn;
{
{
  if (GET_CODE (operands[1]) == MEM
      && ! CONSTANT_ADDRESS_P (XEXP (operands[1], 0)))
    {
      operands[1] = XEXP (operands[1], 0);
      output_asm_insn ("call %*%1", operands);
    }
  else
    output_asm_insn ("call %1", operands);
  if (GET_MODE (operands[0]) == DFmode
      || GET_MODE (operands[0]) == SFmode)
    {
/*      fp_pop_level++; */
      /* pop if reg dead */
      if (!FP_REG_P (operands[0]))
    abort ();
      if (top_dead_p (insn))
    {
      POP_ONE_FP;
    }
    }
  RET;
}





About List