It looks like that. The df_analyze_loop is only looking at the loop BBs, and it is not clear for me if df_analyze_loop is required to have all the df_live_outs correctly computed or not. Do you know if it is true?
If the df_analyze_loop is not supposed to compute all the df_live_outs correctly, then the error resides in how loop-doloop is using the iv_analysis_loop_init(). Thank you for your help, Claudiu On Tue, Dec 13, 2022 at 10:41 AM Eric Botcazou <botca...@adacore.com> wrote: > > > The problem shows in loop-doloop.c when I introduce a loop end pattern > > that replaces the first jump instruction (JUMP_INSN 15) with a pattern > > that clobbers CC reg. However, the DF doesn't look like it works as > > the doloop step cannot find the CC reg alive. Please see > > loop-doloop.c:766. Hence, it introduces the doloop_end patterns, and > > renders the compare instruction (INSN 14) dead code. leading to > > errors. > > So df_get_live_out does not contain the CC register? iv_analysis_loop_init > only performs a local update of the DF information, maybe it does not cover > the basic block containing insn 14 and 15? > > -- > Eric Botcazou > >