diff options
author | Richard Biener <rguenther@suse.de> | 2015-08-31 14:01:45 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-08-31 14:01:45 +0000 |
commit | f196d062919feaf10ec10c67ac0d20f15fcfd2f5 (patch) | |
tree | 883d3ee48ef2bfcf463dc7da46a8ef793e0cc197 /gcc/lto/lto-symtab.c | |
parent | 6974662928334fbca028b2e0fda30721f9fc8afc (diff) | |
download | gcc-f196d062919feaf10ec10c67ac0d20f15fcfd2f5.zip gcc-f196d062919feaf10ec10c67ac0d20f15fcfd2f5.tar.gz gcc-f196d062919feaf10ec10c67ac0d20f15fcfd2f5.tar.bz2 |
lto.c (compare_tree_sccs_1): Compare DECL_ABSTRACT_ORIGIN.
2015-08-31 Richard Biener <rguenther@suse.de>
lto/
* lto.c (compare_tree_sccs_1): Compare DECL_ABSTRACT_ORIGIN.
* lto-symtab.c (lto_symtab_merge): Merge DECL_POSSIBLY_INLINED flag.
(lto_symtab_prevailing_decl): Do not replace a decl that didn't
participate in merging with something else.
From-SVN: r227345
Diffstat (limited to 'gcc/lto/lto-symtab.c')
-rw-r--r-- | gcc/lto/lto-symtab.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c index d50a1ab..c77ae947 100644 --- a/gcc/lto/lto-symtab.c +++ b/gcc/lto/lto-symtab.c @@ -312,6 +312,11 @@ lto_symtab_merge (symtab_node *prevailing, symtab_node *entry) if (TREE_CODE (decl) == FUNCTION_DECL) { + /* Merge decl state in both directions, we may still end up using + the new decl. */ + DECL_POSSIBLY_INLINED (prevailing_decl) |= DECL_POSSIBLY_INLINED (decl); + DECL_POSSIBLY_INLINED (decl) |= DECL_POSSIBLY_INLINED (prevailing_decl); + if (warn_type_compatibility_p (TREE_TYPE (prevailing_decl), TREE_TYPE (decl))) return false; @@ -798,6 +803,18 @@ lto_symtab_prevailing_decl (tree decl) if (TREE_CODE (decl) == FUNCTION_DECL && DECL_ABSTRACT_P (decl)) return decl; + /* When decl did not participate in symbol resolution leave it alone. + This can happen when we streamed the decl as abstract origin + from the block tree of inlining a partially inlined function. + If all, the split function and the original function end up + optimized away early we do not put the abstract origin into the + ltrans boundary and we'll end up ICEing in + dwarf2out.c:gen_inlined_subroutine_die because we eventually + replace a decl with DECL_POSSIBLY_INLINED set with one without. */ + if (TREE_CODE (decl) == FUNCTION_DECL + && ! cgraph_node::get (decl)) + return decl; + /* Ensure DECL_ASSEMBLER_NAME will not set assembler name. */ gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl)); |