gcc源代码分析,debug_rtx()函数,利器啊

修改方法:emit-rtl.c文件里面的gen_rtx()函数里面进行修改。


  va_end (p);
debug_rtx(rt_val);
  return rt_val;        /* Return the new RTX...        */

}



下面是从main开始的rtx的生成顺序

...

(symbol_ref:SI ("main"))

(mem:QI (symbol_ref:SI ("main")))

(mem (nil))

(code_label 0 0 0 1)

(reg:SI 0)

(const_int 8)

(symbol_ref:SI ("*LC0"))

(mem:BLK (symbol_ref:SI ("*LC0")))

(pre_dec:SI (reg:SI 7))

(mem:SI (pre_dec:SI (reg:SI 7)))

(set (mem:SI (pre_dec:SI (reg:SI 7)))
   (symbol_ref:SI ("*LC0")))

(insn_list 6 (nil))

(insn_list 2 (insn_list 6 (nil)))

(sequence[ ] )

(reg:SI 0)

(const_int 4)

(mem:QI (symbol_ref/v:SI ("printf")))

(call (mem:QI (symbol_ref/v:SI ("printf")))
   (const_int 4))

(set (reg:SI 0)
   (call (mem:QI (symbol_ref/v:SI ("printf")))
       (const_int 4)))


(set (reg/i:SI 0)
   (const_int 0))

(use (reg/i:SI 0))

(label_ref 0)

(set (pc)
   (label_ref 0))

(mem (nil))

(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))

(mem (nil))



完整的下载地址:http://pan.baidu.com/s/13oTQ2


你可能感兴趣的:(gcc,源代码,分析,debug_rtx)