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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000e33f81 in field_byte_offset (decl=0x7ffff699d7b8, 
    ctx=0x7fffffffb5e0, cst_offset=0x7fffffffb4a8)
    at /space/rguenther/src/svn/trunk2/gcc/dwarf2out.c:19086
19086     if (TREE_CODE (DECL_FIELD_BIT_OFFSET (decl)) != INTEGER_CST)
(gdb) p decl
$1 = (const_tree) 0x7ffff699d7b8
(gdb) p debug_tree (decl)
 <field_decl 0x7ffff699d7b8 b
    type <integer_type 0x7ffff68985e8 int asm_written public type_6 SI
        size <integer_cst 0x7ffff689c078 constant 32>
        unit-size <integer_cst 0x7ffff689c090 constant 4>
        align:32 warn_if_not_align:0 symtab:-158767472 alias-set -1
canonical-type 0x7ffff68985e8 precision:32 min <integer_cst 0x7ffff689c030
-2147483648> max <integer_cst 0x7ffff689c048 2147483647>
        pointer_to_this <pointer_type 0x7ffff68a19d8>>
    decl_3 VOID t.C:4:11
    align:1 warn_if_not_align:0 offset_align 1 context <record_type
0x7ffff69d1690 S> chain <type_decl 0x7ffff699d720 S>>
$2 = void
(gdb) p decl->field_decl.bit_offset 
$3 = (tree) 0x0
(gdb) p decl->field_decl.offset 
$4 = (tree) 0x0

that's not a valid FIELD_DECL.  The aggregate is

 <record_type 0x7ffff69d1690 S asm_written type_0 type_5 type_6 VOID
    size <integer_cst 0x7ffff687aea0 type <integer_type 0x7ffff68980a8
bitsizetype> constant 0>
    unit-size <integer_cst 0x7ffff687ae58 type <integer_type 0x7ffff6898000
sizetype> constant 0>
    align:8 warn_if_not_align:0 symtab:-158767632 alias-set -1 canonical-type
0x7ffff69d1690
    fields <using_decl 0x7ffff699d850 operator= decl_0 VOID t.C:1:23
        align:1 warn_if_not_align:0 context <record_type 0x7ffff69d1690 S>
result <record_type 0x7ffff69d1690 S>

        chain <field_decl 0x7ffff699d7b8 b type <integer_type 0x7ffff68985e8
int>
            decl_3 VOID t.C:4:11
            align:1 warn_if_not_align:0 offset_align 1 context <record_type
0x7ffff69d1690 S> chain <type_decl 0x7ffff699d720 S>>> context
<translation_unit_decl 0x7ffff6887168 t.C>
    full-name "struct S<<anonymous> >"
    n_parents=0 use_template=0 interface-unknown
    chain <type_decl 0x7ffff699d688 S>>

and we call debug_hooks->type_decl on the __lambda1 TYPE_DECL.

Reply via email to