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

--- Comment #2 from rguenther at suse dot de <rguenther at suse dot de> ---
On Fri, 16 Nov 2018, jakub at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88046
> 
> Jakub Jelinek <jakub at gcc dot gnu.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |jakub at gcc dot gnu.org
> 
> --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> 19236             /* Calculate the address of the offset.  */
> 19237             offset = tree_to_shwi (BINFO_VPTR_FIELD (decl));
> 19238             gcc_assert (offset < 0);

Yeah...

> #1  0x00000000013c98ad in tree_to_shwi (t=0x0) at ../../gcc/tree.c:7084
> #2  0x00000000009e4056 in add_data_member_location_attribute (
>     die=<dw_die_ref 0x7fffefa895f0 DW_TAG_inheritance <parent=0x7fffefa895a0
> DW_TAG_structure_type>>, decl=<tree_binfo 0x7fffefa81000>, 
>     ctx=0x7fffffffce80) at ../../gcc/dwarf2out.c:19237
> #3  0x00000000009f3195 in gen_inheritance_die (binfo=<tree_binfo
> 0x7fffefa81000>, access=<identifier_node 0x7fffefc937f8 public>, 
>     type=<record_type 0x7fffefe7a3f0 b>, 
>     context_die=<dw_die_ref 0x7fffefa895a0 DW_TAG_structure_type
> <parent=0x7fffefa89000 DW_TAG_compile_unit>>) at ../../gcc/dwarf2out.c:24511
> #4  0x00000000009f44d1 in gen_member_die (type=<record_type 0x7fffefe7a3f0 
> b>, 
>     context_die=<dw_die_ref 0x7fffefa895a0 DW_TAG_structure_type
> <parent=0x7fffefa89000 DW_TAG_compile_unit>>) at ../../gcc/dwarf2out.c:24982
> #5  0x00000000009f4eb9 in gen_struct_or_union_type_die (type=<record_type
> 0x7fffefe7a3f0 b>, 
>     context_die=<dw_die_ref 0x7fffefa89500 DW_TAG_lexical_block
> <parent=0x7fffefa89460 DW_TAG_subprogram>>, usage=DINFO_USAGE_DIR_USE)
>     at ../../gcc/dwarf2out.c:25155
> #6  0x00000000009f599a in gen_tagged_type_die (type=<record_type 
> 0x7fffefe7a3f0
> b>, 
>     context_die=<dw_die_ref 0x7fffefa89500 DW_TAG_lexical_block
> <parent=0x7fffefa89460 DW_TAG_subprogram>>, usage=DINFO_USAGE_DIR_USE)
>     at ../../gcc/dwarf2out.c:25356
> #7  0x00000000009f62f1 in gen_type_die_with_usage (type=<record_type
> 0x7fffefe7a3f0 b>, 
>     context_die=<dw_die_ref 0x7fffefa89500 DW_TAG_lexical_block
> <parent=0x7fffefa89460 DW_TAG_subprogram>>, usage=DINFO_USAGE_DIR_USE)
>     at ../../gcc/dwarf2out.c:25551
> #8  0x00000000009f668e in gen_type_die (type=<record_type 0x7fffefe7a3f0 b>, 
>     context_die=<dw_die_ref 0x7fffefa89500 DW_TAG_lexical_block
> <parent=0x7fffefa89460 DW_TAG_subprogram>>) at ../../gcc/dwarf2out.c:25605
> #9  0x00000000009d1c3e in modified_type_die (type=<record_type 0x7fffefe7a3f0
> b>, cv_quals=0, reverse=false, 
>     context_die=<dw_die_ref 0x7fffefa89500 DW_TAG_lexical_block
> <parent=0x7fffefa89460 DW_TAG_subprogram>>) at ../../gcc/dwarf2out.c:13368
> #10 0x00000000009ea658 in add_type_attribute (
>     object_die=<dw_die_ref 0x7fffefa89550 DW_TAG_variable
> <parent=0x7fffefa89500 DW_TAG_lexical_block>>, type=<record_type 
> 0x7fffefe7a3f0
> b>, 
>     cv_quals=0, reverse=false, context_die=<dw_die_ref 0x7fffefa89500
> DW_TAG_lexical_block <parent=0x7fffefa89460 DW_TAG_subprogram>>)
>     at ../../gcc/dwarf2out.c:21532

The issue is this frame though - we shouldn't generate any type DIEs
late or at least, if we are forced to, tune down extremely the fanciness
of that (no inheritance or type fields, etc.).

See the linked bug about -g0 at compile and -g at link-time.

Given we _do_ re-create some types late (the variably-modified ones
because the dwarf/gdb support isn't there yet for the fancy way),
it's not easy to simply early return or ICE.

Reply via email to