This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: inserting insn's into insn chain
- From: Per Fransson <per dot fransson dot 768 at student dot lu dot se>
- To: gcc <gcc at gcc dot gnu dot org>
- Date: Sun, 19 May 2002 20:16:35 +0200
- Subject: Re: inserting insn's into insn chain
Sorry about the formatting in the original posting. Hopefully this looks
better:
tmp_reg_rtx = gen_reg_rtx (SImode);
new_insn = emit_insn_before (
gen_rtx (SET, SImode,
tmp_reg_rtx,
gen_rtx (REG, SImode,
8
)
)
, insn);
// Construct PARALLEL rtx from rtvec and use it to put call insn in chain
new_insn = emit_insn_before (
gen_rtx (PARALLEL, VOIDmode,
gen_rtvec (2,
gen_rtx (SET, VOIDmode,
gen_rtx (REG, SImode,
0
),
gen_rtx (CALL, VOIDmode,
gen_rtx (MEM, SImode,
gen_rtx (SYMBOL_REF, SImode,
func_name
),
0
),
gen_rtx (CONST_INT, VOIDmode,
0
)
)
),
gen_rtx (CLOBBER, VOIDmode,
gen_rtx (REG, SImode,
15
)
)
))
, insn);
new_insn = emit_insn_before (
gen_rtx (SET, SImode,
gen_rtx (REG, SImode,
8
),
copy_rtx (tmp_reg_rtx)
)
, insn);
}