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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think the difference on the reduced testcase between success (first) and hang
(second) is:
(insn 10 16 21 3 (set (reg/v:DI 117 [ hl_ ])
        (subreg:DI (reg/v:V8QI 114 [ v ]) 0)) "ultrasp13.c":19:105 125
{*movdi_insn_sp64}
     (nil))
(insn 21 10 17 3 (set (reg:DI 111 [ ivtmp.11 ])
        (plus:DI (reg:DI 111 [ ivtmp.11 ])
            (const_int 8 [0x8]))) 224 {*adddi3_sp64}
     (nil))
(insn 17 21 18 3 (set (reg:DI 9 %o1)
        (zero_extend:DI (subreg:SI (reg/v:V8QI 114 [ v ]) 4)))
"ultrasp13.c":23:7 179 {*zero_extendsidi2_insn_sp64}
     (expr_list:REG_DEAD (reg/v:V8QI 114 [ v ])
        (nil)))
(insn 18 17 19 3 (set (reg:DI 8 %o0)
        (lshiftrt:DI (reg/v:DI 117 [ hl_ ])
            (const_int 32 [0x20]))) "ultrasp13.c":23:7 403 {*lshrdi3_sp64}
     (expr_list:REG_DEAD (reg/v:DI 117 [ hl_ ])
        (nil)))
vs.
(insn 14 13 18 3 (set (reg:DI 9 %o1)
        (zero_extend:DI (subreg:SI (reg/v:V8QI 114 [ v ]) 4)))
"ultrasp13.c":23:7 179 {*zero_extendsidi2_insn_sp64}
     (nil))
(insn 18 14 15 3 (set (reg:DI 111 [ ivtmp.11 ])
        (plus:DI (reg:DI 111 [ ivtmp.11 ])
            (const_int 8 [0x8]))) 224 {*adddi3_sp64}
     (nil))
(insn 15 18 16 3 (set (reg:DI 8 %o0)
        (zero_extend:DI (subreg:SI (reg/v:V8QI 114 [ v ]) 0)))
"ultrasp13.c":23:7 179 {*zero_extendsidi2_insn_sp64}
     (expr_list:REG_DEAD (reg/v:V8QI 114 [ v ])
        (nil)))
SPARC is big-endian, so I'd guess the non-lowpart subreg in the zero extension
might be a problem.
But in the expand dump it shows up both in the good and bad cases, like:
(insn 11 10 12 4 (set (reg:V4QI 119)
        (subreg:V4QI (reg/v:DI 117 [ hl_ ]) 4)) "ultrasp13.c":23:7 -1
     (nil))

Reply via email to