https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81192
--- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> --- I used dotfn (based on dot-fn in gdbhooks.py): ... void dotfn (const char *name) { FILE *fp = fopen (name, "w"); if (fp == NULL) return; start_graph_dump (fp, "<debug>"); print_graph_cfg (fp, cfun, dump_flags); end_graph_dump (fp); fclose (fp); } ... to debug this test-case and found that the sigsegv goes away when I use dotfn before init_worklist. As it turns out, draw_cfg_edges calls mark_dfs_back_edges, which sets EDGE_DFS_BACK for bb4 -> bb5. Consequently, the outgoing edges of bb4 and bb6 don't have the same flags any more, and tail-merge bails out.