aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-01-15 15:37:38 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-01-15 15:37:38 +0000
commit2bd847fed39669cfd021b9c3068ca84fd98593e4 (patch)
treee8a572d85ba2a84569866ceceeae4a27be711b4f /gcc/dwarf2out.c
parent33a126a6f2669a29a6657bffa96214ea33de211b (diff)
downloadgcc-2bd847fed39669cfd021b9c3068ca84fd98593e4.zip
gcc-2bd847fed39669cfd021b9c3068ca84fd98593e4.tar.gz
gcc-2bd847fed39669cfd021b9c3068ca84fd98593e4.tar.bz2
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
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 61a7bf3..f742900 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -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. */
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)
{
if (debug_info_level > DINFO_LEVEL_NONE
@@ -18581,21 +18601,7 @@ add_linkage_name (dw_die_ref die, tree decl)
&& TREE_PUBLIC (decl)
&& !(TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl))
&& die->die_tag != DW_TAG_member)
- {
- /* 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_linkage_name_raw (die, decl);
}
/* 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)
is the name of the typedef decl naming the anonymous
struct. This greatly eases the work of consumers of
this debug info. */
- add_linkage_attr (lookup_type_die (type), decl);
+ add_linkage_name_raw (lookup_type_die (type), decl);
}
}