On Thu, Apr 7, 2011 at 5:34 AM, Michael Matz <[email protected]> wrote:
> Hi,
>
> On Thu, 7 Apr 2011, Richard Guenther wrote:
>
>> > 5600 newx = simplify_subreg (outermode, op, innermode, byte);
>> > (gdb) f 1
>> > #1 0x0000000000708494 in expand_expr_real_2 (ops=0x7fffffffb0c0,
>> > target=0x0,
>> > tmode=VOIDmode, modifier=EXPAND_INITIALIZER)
>> > at /export/gnu/import/git/gcc-x32/gcc/expr.c:7366
>> > 7366 op0 = simplify_gen_subreg (mode, op0, inner_mode,
>> > (gdb) call debug_tree (treeop0)
>> > <addr_expr 0x7ffff0a78d50
>> > type <pointer_type 0x7ffff0b83f18
>> > type <void_type 0x7ffff0b83e70 void VOID
>> > align 8 symtab 0 alias set -1 canonical type 0x7ffff0b83e70
>> > pointer_to_this <pointer_type 0x7ffff0b83f18>>
>> > sizes-gimplified public unsigned SI
>> > arg 0 <label_decl 0x7ffff0b7b400 l2 type <void_type 0x7ffff0b83e70 void>
>> > (gdb) call debug_rtx (op0)
>> > (label_ref/v:DI 22)
>> > (gdb)
>> >
>>
>> First I wonder what CONSTANT_P object we arrive with here (it looks like
>> something unfolded, given that we likely came here with a NOP_EXPR).
>
> The CONSTANT_P object is the '(label_ref/v:DI 22)'. Not only CONST_INT
> are CONSTANT_P, also some others (symbol_ref too). Those might have a
> mode. Here the label_ref has DImode, but the pointer type in trees points
> to an SImode. The latter makes sense, because that's what ptr_mode is for
> HJs target.
>
> HJ: you'll need to tell us what you mean with 'breaks
> gcc.c-torture/compile/labels-3.c' . What breaks, in which way?
>
I got
#0 fancy_abort (
file=0x12470e0 "/export/gnu/import/git/gcc-x32/gcc/simplify-rtx.c",
line=5266, function=0x1248470 "simplify_subreg")
at /export/gnu/import/git/gcc-x32/gcc/diagnostic.c:893
#1 0x00000000009d0ab5 in simplify_subreg (outermode=HImode, op=0x7ffff0c55dd0,
innermode=SImode, byte=0)
at /export/gnu/import/git/gcc-x32/gcc/simplify-rtx.c:5265
#2 0x00000000009d1e83 in simplify_gen_subreg (outermode=HImode,
op=0x7ffff0c55dd0, innermode=SImode, byte=0)
at /export/gnu/import/git/gcc-x32/gcc/simplify-rtx.c:5600
#3 0x0000000000708736 in expand_expr_real_2 (ops=0x7fffffffb480, target=0x0,
tmode=VOIDmode, modifier=EXPAND_INITIALIZER)
at /export/gnu/import/git/gcc-x32/gcc/expr.c:7366
#4 0x00000000007153e1 in expand_expr_real_1 (exp=0x7ffff0a87f30, target=0x0,
tmode=VOIDmode, modifier=EXPAND_INITIALIZER, alt_rtl=0x0)
at /export/gnu/import/git/gcc-x32/gcc/expr.c:9728
..
(gdb) f 3
#3 0x0000000000708736 in expand_expr_real_2 (ops=0x7fffffffb480, target=0x0,
tmode=VOIDmode, modifier=EXPAND_INITIALIZER)
at /export/gnu/import/git/gcc-x32/gcc/expr.c:7366
7366 op0 = simplify_gen_subreg (mode, op0, inner_mode,
(gdb) call debug_rtx (op0)
(label_ref/v:DI 22)
(gdb) p inner_mode
$2 = SImode
(gdb)
We are calling simplify_gen_subreg with wrong inner_mode.
--
H.J.