On Thu, Dec 11, 2008 at 9:57 AM, Revital1 Eres <[EMAIL PROTECTED]> wrote: > > Hello, > > I have a basic-block and I want to get the last jump insn of it. > I use BB_END (bb) for that purpose. > The instruction I get is a NOTE_INSN_PROLOGUE_END which appears right > before the jump insn; and when doing NEXT_INSN for that note I get > the first insn of the next bb (code_label); which means the jump insn > was skipped... > Investigating this behavior showed that it occurs right after calling > cleanup_cfg () from cfg_layout_initialize (0) (which is been called > at the beginning of the new pass I'm working on -that is placed right > before pass_free_cfg) > It is not clear why BB_END (bb) did not return the jump insn as > expected...
Because you called cfg_layout_initialize (0). It puts the CFG in cfglayout mode. And there are no unconditional jumps in cfglayout mode. You could easily have found this out yourself by printing the basic block (debug_bb_n(2) from gdb) after calling cfg_layout_initialize (0). Gr. Steven