ICE in `find_reloads', at reload.c:4106

John David Anglin dave@hiauly1.hia.nrc.ca
Wed Jun 14 13:51:00 GMT 2000


> Bootstrapping the compiler with the gcc-2.96 CVS source from June 6, results
> in the following error building cp/method.c:
> 
> ../stage1/xgcc -B../stage1/ -B/usr/local/vax-dec-ultrix4.3/bin/ -c  -DIN_GCC    -W -Wall  -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes  -Wno-long-long -O3  -W -Wall    -I. -I.. -I../../../gcc/cp -I../../../gcc/cp/.. -I../../../gcc/cp/../config -I../../../gcc/cp/../../include ../../../gcc/cp/method.c
> ../../../gcc/cp/method.c: In function `build_mangled_name':
> ../../../gcc/cp/method.c:1243: Internal compiler error in `find_reloads', at reload.c:4106

I have been able to debug this to some extent.  The fault occurs for
insn_code_numberr=13 which is the sltu instruction pattern.  Its pattern
is:

(define_insn "sltu"
  [(set (match_operand:SI 0 "general_operand" "=ro")
        (ltu (cc0) (const_int 0)))]
  ""
  "clrl %0\;adwc $0,%0")

The sltu instruction only is generated once at line 1183 of method.c.  This
is the rtl from the previous lreg pass:

(note 164 163 1774 ("../../../gcc/cp/method.c") 1183 0)

;; Start of basic block 23, registers live: 13 [fp] 14 [sp] 21 23 52 53 57 60 446
(note 1774 164 167 [bb 23] NOTE_INSN_BASIC_BLOCK 0)

(insn 167 1774 168 (set (mem/f:SI (pre_dec:SI (reg:SI 14 sp)) 4)
        (const_int 387 [0x183])) 18 {movsi} (nil)
    (nil))

(note 168 167 169 NOTE_INSN_DELETED 0)

(note 169 168 170 NOTE_INSN_DELETED 0)

(note 170 169 171 NOTE_INSN_DELETED 0)

(insn:QI 171 170 172 (set (cc0)
        (compare (mem/f:SI (symbol_ref:SI ("maxtype")) 4)
            (mem/s:SI (mem/f:SI (symbol_ref:SI ("typevec")) 47) 4))) 5 {cmpsi} (nil)
    (nil))

(note:HI 172 171 173 NOTE_INSN_DELETED 0)

(insn 173 172 174 (set (mem/f:SI (pre_dec:SI (reg:SI 14 sp)) 4)
        (ltu:SI (cc0)
            (const_int 0 [0x0]))) 13 {sltu} (nil)
    (nil))

(note 174 173 175 NOTE_INSN_DELETED 0)

(call_insn 175 174 176 (parallel[ 
            (call (mem:QI (symbol_ref:SI ("my_friendly_assert")) 0)
                (const_int 8 [0x8]))
            (set (reg:SI 14 sp)
                (plus:SI (reg:SI 14 sp)
                    (const_int 8 [0x8])))
        ] ) 136 {call_pop} (nil)
    (nil)
    (nil))

(note 176 175 177 ("../../../gcc/cp/method.c") 1184 0)

>From gdb, I find the following values at the abort:

(gdb) print noperands
$30 = 1
(gdb) print insn_code_number
$32 = 13
(gdb) print operand_type[0]
$33 = RELOAD_FOR_OUTPUT
(gdb) print rld[0]
$34 = {in = 0xbaa0a0, out = 0x0, class = ALL_REGS, inmode = SImode, 
  outmode = VOIDmode, mode = SImode, nregs = 1, inc = 4, in_reg = 0xbaa0a0, 
  out_reg = 0x0, regno = -1, reg_rtx = 0x0, opnum = 0, 
  secondary_in_reload = -1, secondary_out_reload = -1, 
  secondary_in_icode = CODE_FOR_nothing, 
  secondary_out_icode = CODE_FOR_nothing, when_needed = RELOAD_FOR_INPUT, 
  optional = 0, nocombine = 0, secondary_p = 0, nongroup = 0}
(gdb) print *rld[0].in
$36 = {code = PRE_DEC, mode = SImode, jump = 0, call = 0, unchanging = 0, 
  volatil = 0, in_struct = 0, used = 1, integrated = 0, frame_related = 0, 
  fld = {{rtwint = 1702016, rtint = 1702016, rtuint = 1702016, 
      rtstr = 0x19f880 "9", rtx = 0x19f880, rtvec = 0x19f880, 
      rttype = 1702016, rt_addr_diff_vec_flags = {min_align = 128, 
	base_after_vec = 0, min_after_vec = 0, max_after_vec = 0, 
	min_after_base = 1, max_after_base = 1, offset_unsigned = 1,  = 3, 
	scale = 25}, rt_cselib = 0x19f880, rtbit = 0x19f880, 
      rttree = 0x19f880, bb = 0x19f880}}}

Why does rld[0] contain data for an input reload when the only
input for the instruction is cc0?  Is this residual garbage?

The problem could probably be fixed by deleting the sltu pattern but
this isn't the real fix.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)


More information about the Gcc-bugs mailing list