[Bug target/67657] [SH][5]: internal compiler error: in cselib_record_set, at cselib.c:2396 when compiling libjpeg-turbo

kkojima at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Sep 21 02:08:00 GMT 2015


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

--- Comment #2 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
Created attachment 36356
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36356&action=edit
reduced test case

I can reproduce it with trunk rev. 227929 but can't with 227887.
Clearly very fragile.
It looks that the insn

(insn:TI 2292 1994 1995 11 (parallel [
            (set (reg/v/f:SI 2 r2 [orig:320 outptr ] [320])
                (mem/f:SI (reg:SI 2 r2) [2 MEM[base: _145, offset: 0B]+0 S4
A32]))
            (set (reg:SI 2 r2)
                (plus:SI (reg:SI 2 r2)
                    (const_int 4 [0x4])))
        ]) foo.c:61 253 {movsi_ie}
     (expr_list:REG_UNUSED (reg:SI 2 r2)
        (expr_list:REG_INC (reg:SI 2 r2)
            (nil))))

makes cselib unhappy.  It looks wrong anyway.

It seems that

;;      mov.l   @(r0,r9),r1
;;      mov     r1,r0       ->  mov     @(r0,r9),r0
(define_peephole2
  [(set (match_operand:SI 0 "arith_reg_dest")
        (match_operand:SI 1 "general_movsrc_operand"))
   (set (match_operand:SI 2 "arith_reg_dest")
        (match_dup 0))]
  "TARGET_SH1 && peep2_reg_dead_p (2, operands[0])"
  [(const_int 0)]
{
  sh_check_add_incdec_notes (emit_move_insn (operands[2], operands[1]));
})

took 2 insns

(insn 595 1951 1954 20 (set (reg:SI 0 r0)
        (mem/f:SI (post_inc:SI (reg:SI 2 r2)) [2 MEM[base: _145, offset: 0B]+0
S4 A32])) foo.c:61 253 {movsi_ie}
     (expr_list:REG_UNUSED (reg:SI 2 r2)
        (expr_list:REG_INC (reg:SI 2 r2)
            (nil))))

(insn 1954 595 1994 20 (set (reg/v/f:SI 2 r2 [orig:320 outptr ] [320])
        (reg:SI 0 r0)) foo.c:61 253 {movsi_ie}
     (expr_list:REG_DEAD (reg:SI 0 r0)
        (nil)))

into the insn 2292.  Oleg, could you take a look?



More information about the Gcc-bugs mailing list