[Bug rtl-optimization/96015] [10/11 Regression] gcc-10.1.0 miscompiles Python on hppa

ebotcazou at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 3 08:23:43 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96015

--- Comment #29 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
It's again __builtin_unreachable making a mess in the RTL stream:

(note 23 11 24 [bb 3] NOTE_INSN_BASIC_BLOCK)
(jump_insn:TI 24 23 15 (set (pc)
        (if_then_else (leu (reg/v:SI 24 %r24 [orig:99 g ] [99])
                (const_int 5 [0x5]))
            (label_ref:SI 81)
            (pc))) 30 {*pa.md:1413}
     (int_list:REG_BR_PROB 536870916 (nil))
 -> 81)
(code_label 15 24 17 4 (nil) [2 uses])
(barrier 17 15 16)
(note 16 17 81 [bb 4] NOTE_INSN_BASIC_BLOCK)
(code_label 81 16 43 12 (nil) [1 uses])
(note 43 81 25 [bb 5] NOTE_INSN_BASIC_BLOCK)
(jump_insn:TI 25 43 26 (parallel [
            (set (pc)
                (mem:SI (plus:SI (mult:SI (reg/v:SI 24 %r24 [orig:99 g ] [99])
                            (const_int 4 [0x4]))
                        (label_ref 26)) [0  S4 A32]))
            (clobber (reg:SI 28 %r28))
        ]) 198 {casesi32}
     (expr_list:REG_DEAD (reg/v:SI 24 %r24 [orig:99 g ] [99])
        (expr_list:REG_UNUSED (reg:SI 28 %r28)
            (nil)))
 -> 26)

relax_delay_slots sees that jump_insn 24 jumps to the next active instruction
so it proceeds with removing it.  Its target label 81 has only one use so it is
removed too.  At this point delete_related_insns thinks that it can also remove
all the instructions after label 81 down to the next label because of the
presence of barrier 17:

  /* If INSN was a label, delete insns following it if now unreachable.  */

  if (was_code_label && prev && BARRIER_P (prev))
    {
      enum rtx_code code;
      while (next)
        {


More information about the Gcc-bugs mailing list