aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-07-25 12:10:13 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-07-25 12:10:13 +0000
commit9c13689e64e4c13428c0745c02ee587be141fa2a (patch)
treee090c5ebf71c21304c1c60a573bbb118b915ed0b
parenta9d49e9681cb68b6ead50c0c526d2b3d84bd3dd9 (diff)
downloadgcc-9c13689e64e4c13428c0745c02ee587be141fa2a.zip
gcc-9c13689e64e4c13428c0745c02ee587be141fa2a.tar.gz
gcc-9c13689e64e4c13428c0745c02ee587be141fa2a.tar.bz2
re PR lto/86654 (ICE in gen_member_die, at dwarf2out.c:24933)
2018-07-25 Richard Biener <rguenther@suse.de> PR debug/86654 * dwarf2out.c (dwarf2out_decl): Do not handle nested functions special wrt context_die late. (gen_subprogram_die): Re-use DIEs in local scope. From-SVN: r262965
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/dwarf2out.c8
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 09c2f5f..202b43b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2018-07-25 Richard Biener <rguenther@suse.de>
+
+ PR debug/86654
+ * dwarf2out.c (dwarf2out_decl): Do not handle nested functions
+ special wrt context_die late.
+ (gen_subprogram_die): Re-use DIEs in local scope.
+
2018-07-25 Richard Sandiford <richard.sandiford@arm.com>
PR tree-optimization/86644
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 8377cbc..208f2e9 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -22766,6 +22766,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
*/
|| (old_die->die_parent
&& old_die->die_parent->die_tag == DW_TAG_module)
+ || local_scope_p (old_die->die_parent)
|| context_die == NULL)
&& (DECL_ARTIFICIAL (decl)
|| (get_AT_file (old_die, DW_AT_decl_file) == file_index
@@ -26702,8 +26703,11 @@ dwarf2out_decl (tree decl)
case FUNCTION_DECL:
/* If we're a nested function, initially use a parent of NULL; if we're
a plain function, this will be fixed up in decls_for_scope. If
- we're a method, it will be ignored, since we already have a DIE. */
- if (decl_function_context (decl)
+ we're a method, it will be ignored, since we already have a DIE.
+ Avoid doing this late though since clones of class methods may
+ otherwise end up in limbo and create type DIEs late. */
+ if (early_dwarf
+ && decl_function_context (decl)
/* But if we're in terse mode, we don't care about scope. */
&& debug_info_level > DINFO_LEVEL_TERSE)
context_die = NULL;