http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58668
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu.org --- Comment #5 from Jakub Jelinek <jakub 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. - count_bb_insns counts CALL_INSN and INSN - flow_find_cross_jump counts in some cases the jump insn (quite complicated test whether it counts it or not), and doesn't count insns with USE or CLOBBER PATTERNs - flow_find_head_matching_sequence counts all CALL_INSN/INSN, including USE and CLOBBER - first_active_insn finds what count_bb_insns counts - last_active_insn (..., TRUE) finds what count_bb_insns except it skips over USE patterns 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. So, perhaps 1) let count_bb_insns not count insns with USE or CLOBBER PATTERNs 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? 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?