https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83962
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2018-01-23 CC| |abel at gcc dot gnu.org, | |amonakov at gcc dot gnu.org, | |jakub at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Bisecting, but the ICE is very old. Anyway, what I see is we have EDGE_FALLTHRU edge as the single edge out of a bb not ending with any jump, then in reorder_basic_blocks -> set_edge_can_fallthru_flag EDGE_CAN_FALLTHRU is ored with it. Then cfg_layout_finalize -> fixup_reorder_chain -> force_nonfallthru_and_redirect clears the EDGE_FALLTHRU bit in and adds an unconditional jump to the target bb. But then selective scheduling (sched2 pass) creates bogus: (code_label 51 29 50 8 7 (nil) [0 uses]) (note 50 51 98 8 [bb 8] NOTE_INSN_BASIC_BLOCK) (insn 98 50 82 8 (set (reg:SI 3 3 [orig:123 iftmp.0_4 ] [123]) (reg:SI 10 10 [orig:140 iftmp.0_4 ] [140])) 487 {*movsi_internal1} (nil)) ;; succ: 10 [always] (CAN_FALLTHRU) ;; lr out 1 [1] 3 [3] 7 [7] 8 [8] 9 [9] 10 [10] 73 [5] (barrier 82 98 32) ;; basic block 10, loop depth 0, maybe hot ;; prev block 8, next block 1, flags: (REACHABLE, RTL, MODIFIED) ;; pred: 5 (CAN_FALLTHRU) ;; 7 (CAN_FALLTHRU) ;; 8 [always] (CAN_FALLTHRU) ;; 4 (CAN_FALLTHRU) ;; 6 (CAN_FALLTHRU) ;; bb 10 artificial_defs: { } ;; bb 10 artificial_uses: { u-1(1){ }} ;; lr in 1 [1] 3 [3] 7 [7] 8 [8] 9 [9] 10 [10] 73 [5] ;; lr use 1 [1] 3 [3] ;; lr def 3 [3] 4 [4] 76 [ca] (code_label 32 82 33 10 3 (nil) [4 uses]) out of that, if the edge falls through into the next bb, it should be EDGE_FALLTHRU, and the barrier should be left out, or there should be an unconditional jump other passes could remove as unneeded later on.