daniel tian <daniel.xnt...@gmail.com> writes: > 2009/12/11 Ian Lance Taylor <i...@google.com>: >> daniel tian <daniel.xnt...@gmail.com> writes: >> >>> I have a problem about RTL sequence. >>> If I wanna generate the RTL in sequence, and don't let gcc to schedule >>> them. >>> Like the following(all the variable is rtx): >>> >>> emit_insn(reg0, operands[0]); >>> emit_insn(reg1, reg0); >>> emit_insn(operands[0], reg1); >>> >>> But gcc will will reorder the three rtl in optimization. >>> I just wanna the those rtl in one block as a unit, don't let the >>> gcc disrupt the sequence. >>> How can I do it? >> >> Write a single define_insn which emits the instructions you want to >> treat as a unit. >> > > Does there any solution in RTL level? > Because I already solve the problem in ASM output level, exactly the > same solution as you suggest in this email. > I may need do some optimization later. So RTL level will be great!
As far as I know there is no way to do this at the RTL level. I don't know why there would be a way, as it does not strike me as a useful feature to have. If the instructions must stay together at the assembly level, use a single define_insn. If you use multiple define_insns, then it's OK for the compiler to move them around. Ian