This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Code Motion after Machine Dependent Reorganization??
- From: Ian Lance Taylor <iant at google dot com>
- To: "Balaji V. Iyer" <bviyer at ncsu dot edu>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 30 Dec 2008 07:50:32 -0800
- Subject: Re: Code Motion after Machine Dependent Reorganization??
- References: <14058E8DB1D1447A97F11CBD3A4EF9F0@ece.ncsu.edu>
"Balaji V. Iyer" <bviyer@ncsu.edu> writes:
> I printed out the RTL dump using the following code during the machine
> dependent reorganization
>
>
> FOR_EACH_BB(bb) {
> for (insn = bb_head(bb); insn != bb_end(bb); insn = NEXT_INSN(insn))
> {
> if (INSN_P(insn))
> print_rtl_single(insn);
> }
> }
>
> Then I compared with the assembly output and the RTL-equivalent and they
> do not come out in the same order.. A couple instructions were even
> moved outside a basic-block... Am I going through the instruction chain
> in the wrong way?
The CFG is not valid at the point of the machine reorg pass, mainly
for historical reasons. You can see all the insns reliably by doing
for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn))
Ian