http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58668
--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- > I think the problem is that ifcvt relies on consistent counting of insns, > but the various functions count different things. What kind of insns is responsible for the discrepancy that leads to the ICE? > I guess best would be to count/skip/etc. the same things consistently, the > problem is that some of the functions have other uses etc. In any case, this would be a sensible approach. > 1) let count_bb_insns not count insns with USE or CLOBBER PATTERNs Agreed. > 2) perhaps not count any JUMP_INSNs in flow_find_cross_jump if dir_p == NULL > (i.e. > when called from ifcvt)? > 3) perhaps not count USE/CLOBBER insns in flow_find_head_matching_sequence if > stop_after is non-zero? I'd first make the functions behave the same wrt USE and CLOBBER insns. > 4) perhaps add also skip_use argument to first_active_insn and if TRUE, > ignore USE insns and for both {first,last}_active_insn if skip_use is TRUE, > also ignore CLOBBER insns > > 5) in find_active_insn_{before,after} ignore USE/CLOBBER insns > and document this properly? I'm less sure about these ones: does their behavior need to be in keeping with the insns counting?