This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fwd: RTL help needed


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]