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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, we have bb 6:
(note 180 23 24 6 [bb 6] NOTE_INSN_BASIC_BLOCK)
(insn 24 180 25 6 (set (reg:DI 1 %r1 [orig:88 b ] [88])
        (zero_extend:DI (reg:SI 1 %r1 [orig:85 b+4 ] [85]))) method-to-ir3.i:15
184 {*zero_extendsidi2}
     (nil))
(insn 25 24 289 6 (set (reg:DI 1 %r1 [orig:88 b ] [88])
        (ashift:DI (reg:DI 1 %r1 [orig:88 b ] [88])
            (const_int 3 [0x3]))) method-to-ir3.i:15 570 {*ashldi3}
     (nil))
(insn 289 25 27 6 (set (reg/f:DI 2 %r2 [158])
        (mem/c:DI (plus:DI (reg/f:DI 15 %r15)
                (const_int 184 [0xb8])) [5 %sfp+-8 S8 A64])) method-to-ir3.i:15
63 {*movdi_64}
     (nil))
(insn 27 289 28 6 (set (reg:DI 1 %r1 [87])
        (mem/u/c:DI (plus:DI (reg/f:DI 2 %r2 [158])
                (reg:DI 1 %r1 [orig:88 b ] [88])) [0  S8 A8]))
method-to-ir3.i:15 63 {*movdi_64}
     (expr_list:REG_EQUAL (mem/u/c:DI (plus:DI (reg:DI 1 %r1 [orig:88 b ] [88])
                (label_ref:DI 29)) [0  S8 A8])
        (nil)))
(jump_insn 28 27 29 6 (parallel [
            (set (pc)
                (plus:DI (reg/f:DI 2 %r2 [158])
                    (reg:DI 1 %r1 [87])))
            (use (label_ref 29))
        ]) method-to-ir3.i:15 626 {casesi_jump}
     (expr_list:REG_DEAD (reg/f:DI 2 %r2 [158])
        (expr_list:REG_DEAD (reg:DI 1 %r1 [87])
            (nil)))
 -> 29)
with:
(code_label 29 28 30 7 "" [2 uses])
(jump_table_data 30 29 31 (addr_diff_vec:DI (label_ref:DI 29)
         [
            (label_ref:DI 50)
            (label_ref:DI 50)
            (label_ref:DI 50)
            (label_ref:DI 50)
        ]
        (const_int 0 [0])
        (const_int 0 [0])))
after it (outside of bb) (as all the case labels do the same thing, they have
been jump threaded, but unfortunately not at GIMPLE, but only at RTL level) and
post_order_compute calls tidy_fallthru_edges which calls tidy_fallthru_edge
on the only successor edge from bb 6 (6 -> 9, bb 9 is the bb starting with
code_label 50).  When all the jump_table_data labels point to the same
destination, it is reasonable to optimize that to direct jump, but I guess we
need to take care about making sure that the code_label before the
jump_table_data is only removed when it has zero LABEL_NUSES.

Reply via email to