Commit 2bd847fe by Richard Biener Committed by Richard Biener

re PR debug/69137 (ICE in odr_type_p, at ipa-utils.h:257)

2016-01-15  Richard Biener  <rguenther@suse.de>

	PR debug/69137
	* dwarf2out.c (add_linkage_name_raw): New function split out from ...
	(add_linkage_name): ... here.
	(gen_typedef_die): Use add_linkage_name_raw instead of
	add_linkage_attr to delay DECL_ASSEMBLER_NAME computation
	if necessary.

	* g++.dg/lto/pr69137_0.C: New testcase.

From-SVN: r232434
parent 33a126a6
2016-01-15 Richard Biener <rguenther@suse.de>
PR debug/69137
* dwarf2out.c (add_linkage_name_raw): New function split out from ...
(add_linkage_name): ... here.
(gen_typedef_die): Use add_linkage_name_raw instead of
add_linkage_attr to delay DECL_ASSEMBLER_NAME computation
if necessary.
2016-01-15 Cesar Philippidis <cesar@codesourcery.com> 2016-01-15 Cesar Philippidis <cesar@codesourcery.com>
* gimplify.c (oacc_default_clause): Decode reference and pointer * gimplify.c (oacc_default_clause): Decode reference and pointer
......
...@@ -18574,6 +18574,26 @@ add_src_coords_attributes (dw_die_ref die, tree decl) ...@@ -18574,6 +18574,26 @@ add_src_coords_attributes (dw_die_ref die, tree decl)
/* Add DW_AT_{,MIPS_}linkage_name attribute for the given decl. */ /* Add DW_AT_{,MIPS_}linkage_name attribute for the given decl. */
static void static void
add_linkage_name_raw (dw_die_ref die, tree decl)
{
/* Defer until we have an assembler name set. */
if (!DECL_ASSEMBLER_NAME_SET_P (decl))
{
limbo_die_node *asm_name;
asm_name = ggc_cleared_alloc<limbo_die_node> ();
asm_name->die = die;
asm_name->created_for = decl;
asm_name->next = deferred_asm_name;
deferred_asm_name = asm_name;
}
else if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
add_linkage_attr (die, decl);
}
/* Add DW_AT_{,MIPS_}linkage_name attribute for the given decl if desired. */
static void
add_linkage_name (dw_die_ref die, tree decl) add_linkage_name (dw_die_ref die, tree decl)
{ {
if (debug_info_level > DINFO_LEVEL_NONE if (debug_info_level > DINFO_LEVEL_NONE
...@@ -18581,21 +18601,7 @@ add_linkage_name (dw_die_ref die, tree decl) ...@@ -18581,21 +18601,7 @@ add_linkage_name (dw_die_ref die, tree decl)
&& TREE_PUBLIC (decl) && TREE_PUBLIC (decl)
&& !(TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl)) && !(TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl))
&& die->die_tag != DW_TAG_member) && die->die_tag != DW_TAG_member)
{ add_linkage_name_raw (die, decl);
/* Defer until we have an assembler name set. */
if (!DECL_ASSEMBLER_NAME_SET_P (decl))
{
limbo_die_node *asm_name;
asm_name = ggc_cleared_alloc<limbo_die_node> ();
asm_name->die = die;
asm_name->created_for = decl;
asm_name->next = deferred_asm_name;
deferred_asm_name = asm_name;
}
else if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
add_linkage_attr (die, decl);
}
} }
/* Add a DW_AT_name attribute and source coordinate attribute for the /* Add a DW_AT_name attribute and source coordinate attribute for the
...@@ -22425,7 +22431,7 @@ gen_typedef_die (tree decl, dw_die_ref context_die) ...@@ -22425,7 +22431,7 @@ gen_typedef_die (tree decl, dw_die_ref context_die)
is the name of the typedef decl naming the anonymous is the name of the typedef decl naming the anonymous
struct. This greatly eases the work of consumers of struct. This greatly eases the work of consumers of
this debug info. */ this debug info. */
add_linkage_attr (lookup_type_die (type), decl); add_linkage_name_raw (lookup_type_die (type), decl);
} }
} }
......
2016-01-15 Richard Biener <rguenther@suse.de>
PR debug/69137
* g++.dg/lto/pr69137_0.C: New testcase.
2016-01-15 Richard Sandiford <richard.sandiford@arm.com> 2016-01-15 Richard Sandiford <richard.sandiford@arm.com>
PR middle-end/69246 PR middle-end/69246
......
// { dg-lto-do link }
// { dg-lto-options { { -std=c++11 -g -flto } } }
// { dg-extra-ld-options "-r -nostdlib" }
typedef struct {
typedef struct { } VarSelectorRecord;
} Format14Cmap;
void fn1() { Format14Cmap a; }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment