aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-10-04 11:23:18 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-10-04 11:23:18 +0000
commit5c1eb617e427a417dd7e1f79eee15b38362dbf53 (patch)
tree8bbabc4c74321f88facd411646c5cf2e47605c23 /gcc/dwarf2out.c
parent9cb62ce3c795fe9991d20a294a53c1bbeadf2751 (diff)
downloadgcc-5c1eb617e427a417dd7e1f79eee15b38362dbf53.zip
gcc-5c1eb617e427a417dd7e1f79eee15b38362dbf53.tar.gz
gcc-5c1eb617e427a417dd7e1f79eee15b38362dbf53.tar.bz2
re PR lto/47788 (New LTO failures)
2012-10-04 Richard Guenther <rguenther@suse.de> PR lto/47788 * tree-streamer-out.c (write_ts_block_tree_pointers): For inlined functions outer scopes write the ultimate origin as BLOCK_ABSTRACT_ORIGIN and BLOCK_SOURCE_LOCATION. Do not stream the fragment chains. * tree-streamer-in.c (lto_input_ts_block_tree_pointers): Likewise. * dwarf2out.c (gen_subprogram_die): Handle NULL DECL_INITIAL. (dwarf2out_decl): Always output DECL_ABSTRACT function decls. From-SVN: r192075
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 25f57c0..95fc130 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -17329,7 +17329,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
a BLOCK node representing the function's outermost pair of curly braces,
and any blocks used for the base and member initializers of a C++
constructor function. */
- if (! declaration && TREE_CODE (outer_scope) != ERROR_MARK)
+ if (! declaration && outer_scope && TREE_CODE (outer_scope) != ERROR_MARK)
{
int call_site_note_count = 0;
int tail_call_site_note_count = 0;
@@ -19622,8 +19622,14 @@ dwarf2out_decl (tree decl)
inline" functions as DECL_EXTERNAL, but we need to generate DWARF for
them anyway. Note that the C++ front-end also plays some similar games
for inline function definitions appearing within include files which
- also contain `#pragma interface' pragmas. */
- if (DECL_INITIAL (decl) == NULL_TREE)
+ also contain `#pragma interface' pragmas.
+
+ If we are called from dwarf2out_abstract_function output a DIE
+ anyway. We can end up here this way with early inlining and LTO
+ where the inlined function is output in a different LTRANS unit
+ or not at all. */
+ if (DECL_INITIAL (decl) == NULL_TREE
+ && ! DECL_ABSTRACT (decl))
return;
/* If we're a nested function, initially use a parent of NULL; if we're