This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: more simplify_subreg aborts


: This can't possibly be fixing the real bug.  I presume you've got
: something like
: 
: (subreg:QI (const_int ...))
:
: ?

   It's a workaround not a bug fix.

   For the v850, it's dealing with label_refs.  try_combine
   gets called with:

(gdb) call debug_rtx(i3)

(insn 57 56 58 (set:SI (reg/f:SI 50)
        (label_ref 65)) 3 {*movsi_lo} (insn_list 56 (nil))
    (expr_list:REG_DEAD (reg/f:SI 51)
        (expr_list:REG_EQUAL (label_ref 65)
            (insn_list:REG_LABEL 65 (nil)))))
(gdb) call debug_rtx(i2)

(insn 56 55 57 (set:SI (reg/f:SI 51)
        (high:SI (label_ref 65))) 2 {*movsi_high} (nil)
    (expr_list:REG_EQUAL (high:SI (label_ref 65))
        (insn_list:REG_LABEL 65 (nil))))

which eventually ends up aborting in simplify_gen_subreg because
the mode of labelref is VOIDmode.

(gdb) down 1
#2  0x8181334 in simplify_set (x=0x4018cc00) at /home/clm/src/egcs/egcs/gcc/combine.c:4877
4877          src = force_to_mode (src, mode, ~(HOST_WIDE_INT) 0, NULL_RTX, 0);
(gdb) call debug_rtx(x)

(set:SI (reg/f:SI 50)
    (label_ref 65))
(gdb) down 1
#1  0x8187723 in gen_lowpart_for_combine (mode=SImode, x=0x4018cf80)
    at /home/clm/src/egcs/egcs/gcc/combine.c:9766
9766          res = simplify_gen_subreg (mode, x, GET_MODE (x), offset);
(gdb) call debug_rtx(x)

(label_ref 65)

gdb) down 1
#0  simplify_gen_subreg (outermode=SImode, op=0x4018cf80, innermode=VOIDmode, byte=0)
    at /home/clm/src/egcs/egcs/gcc/simplify-rtx.c:2450
2450      if (innermode == VOIDmode || outermode == VOIDmode
(gdb) l
2445         unsigned int byte;
2446         enum machine_mode outermode, innermode;
2447    {
2448      rtx new;
2449      /* Little bit of sanity checking.  */
2450      if (innermode == VOIDmode || outermode == VOIDmode
2451          || innermode == BLKmode || outermode == BLKmode)
2452        return 0;
2453
2454      if (GET_MODE (op) != innermode
(gdb) p innermode
$1 = VOIDmode


Catherine


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]