On Mon, May 27, 2019 at 02:18:37PM +0200, Martin Liška wrote: > +/* Compare loop information for basic blocks BB1 and BB2. */ > + > +bool > +func_checker::compare_loops (basic_block bb1, basic_block bb2) > +{ > + if ((bb1->loop_father == NULL) != (bb2->loop_father == NULL)) > + return return_false (); > + > + struct loop *l1 = bb1->loop_father; > + struct loop *l2 = bb2->loop_father;
Perhaps also if ((bb1 == l1->header) != (bb2 == l2->header)) return return_false_with_msg ("header"); if ((bb1 == l1->latch) != (bb2 == l2->latch)) return return_false_with_msg ("latch"); too? BTW, unrelated to this patch, what does ICF do if e.g. SSA_NAME_PTR_INFO or SSA_NAME_RANGE_INFO is different between otherwise identical functions? Say one having early if (arg > 10) __builtin_unreachable (); and another one if (arg > - 10) __builtin_unreachable (); both optimized away into SSA_NAME_RANGE_INFO of the argument before IPA (or do we optimize that away only after IPA?). Jakub