Commit f196d062 by Richard Biener Committed by Richard Biener

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
parent 69746629
2015-08-31 Richard Biener <rguenther@suse.de> 2015-08-31 Richard Biener <rguenther@suse.de>
* 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.
2015-08-31 Richard Biener <rguenther@suse.de>
* lto-symtab.c (lto_symtab_prevailing_decl): Remove redundant * lto-symtab.c (lto_symtab_prevailing_decl): Remove redundant
test, do not replace a non-builtin with a builtin. test, do not replace a non-builtin with a builtin.
* lto.c (compare_tree_sccs_1): Do not merge things we stream * lto.c (compare_tree_sccs_1): Do not merge things we stream
......
...@@ -312,6 +312,11 @@ lto_symtab_merge (symtab_node *prevailing, symtab_node *entry) ...@@ -312,6 +312,11 @@ lto_symtab_merge (symtab_node *prevailing, symtab_node *entry)
if (TREE_CODE (decl) == FUNCTION_DECL) 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), if (warn_type_compatibility_p (TREE_TYPE (prevailing_decl),
TREE_TYPE (decl))) TREE_TYPE (decl)))
return false; return false;
...@@ -798,6 +803,18 @@ lto_symtab_prevailing_decl (tree decl) ...@@ -798,6 +803,18 @@ lto_symtab_prevailing_decl (tree decl)
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_ABSTRACT_P (decl)) if (TREE_CODE (decl) == FUNCTION_DECL && DECL_ABSTRACT_P (decl))
return 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. */ /* Ensure DECL_ASSEMBLER_NAME will not set assembler name. */
gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl)); gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl));
......
...@@ -1305,6 +1305,7 @@ compare_tree_sccs_1 (tree t1, tree t2, tree **map) ...@@ -1305,6 +1305,7 @@ compare_tree_sccs_1 (tree t1, tree t2, tree **map)
compare_tree_edges (DECL_SIZE (t1), DECL_SIZE (t2)); compare_tree_edges (DECL_SIZE (t1), DECL_SIZE (t2));
compare_tree_edges (DECL_SIZE_UNIT (t1), DECL_SIZE_UNIT (t2)); compare_tree_edges (DECL_SIZE_UNIT (t1), DECL_SIZE_UNIT (t2));
compare_tree_edges (DECL_ATTRIBUTES (t1), DECL_ATTRIBUTES (t2)); compare_tree_edges (DECL_ATTRIBUTES (t1), DECL_ATTRIBUTES (t2));
compare_tree_edges (DECL_ABSTRACT_ORIGIN (t1), DECL_ABSTRACT_ORIGIN (t2));
if ((code == VAR_DECL if ((code == VAR_DECL
|| code == PARM_DECL) || code == PARM_DECL)
&& DECL_HAS_VALUE_EXPR_P (t1)) && DECL_HAS_VALUE_EXPR_P (t1))
......
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