Fwd: RTL help needed

Jim Wilson wilson@specifixinc.com
Fri Jun 25 02:39:00 GMT 2004


kripashankar wrote:

> There are two tree addresses - 0x4001a294 and
> 0x4001a2c0.. How are they related to each other??

This is BLOCK_FOR_INSN.  It points to the basic block that contains the 
insn.  You normally don't have to worry about this when generating RTL.

>     rcode = rtx_alloc(SET);
>     XEXP(rcode, 0) = rtx_alloc(REG);
 >    PUT_MODE(XEXP(rcode, 0), SImode);

Such low level calls won't work.  Use GEN_INT (21) to create a 
const_int.  Use gen_reg_rtx () to create a new pseudo-reg, or 
gen_rtx_REG to create a new reg with a specifix register number.  Use 
emit_move_insn to create simple move insns.  Otherwise, use named 
patterns, e.g. gen_addsi3 to generate an SImode add.

There are lots of examples in the code that generate RTL to look at to 
get more ideas.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc mailing list