Commit 45aee888 by Richard Biener Committed by Richard Biener

lto-symtab.c (lto_symtab_prevailing_decl): Remove redundant test, do not replace…

lto-symtab.c (lto_symtab_prevailing_decl): Remove redundant test, do not replace a non-builtin with a builtin.

2015-08-31  Richard Biener  <rguenther@suse.de>

	lto/
	* lto-symtab.c (lto_symtab_prevailing_decl): Remove redundant
	test, do not replace a non-builtin with a builtin.
	* lto.c (compare_tree_sccs_1): Do not merge things we stream
	as builtins vs. non-builtins.

From-SVN: r227339
parent 6c1bc27c
2015-08-31 Richard Biener <rguenther@suse.de>
* lto-symtab.c (lto_symtab_prevailing_decl): Remove redundant
test, do not replace a non-builtin with a builtin.
* lto.c (compare_tree_sccs_1): Do not merge things we stream
as builtins vs. non-builtins.
2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org> 2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
* lto.h: Remove useless typedefs. * lto.h: Remove useless typedefs.
......
...@@ -798,11 +798,6 @@ lto_symtab_prevailing_decl (tree decl) ...@@ -798,11 +798,6 @@ 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;
/* Likewise builtins are their own prevailing decl. This preserves
non-builtin vs. builtin uses from compile-time. */
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (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));
...@@ -811,5 +806,9 @@ lto_symtab_prevailing_decl (tree decl) ...@@ -811,5 +806,9 @@ lto_symtab_prevailing_decl (tree decl)
if (!ret) if (!ret)
return decl; return decl;
/* Do not replace a non-builtin with a builtin. */
if (is_builtin_fn (ret->decl))
return decl;
return ret->decl; return ret->decl;
} }
...@@ -1054,8 +1054,10 @@ compare_tree_sccs_1 (tree t1, tree t2, tree **map) ...@@ -1054,8 +1054,10 @@ compare_tree_sccs_1 (tree t1, tree t2, tree **map)
return false; return false;
/* We don't want to compare locations, so there is nothing do compare /* We want to compare locations up to the point where it makes
for TS_DECL_MINIMAL. */ a difference for streaming - thus whether the decl is builtin or not. */
if (CODE_CONTAINS_STRUCT (code, TS_DECL_MINIMAL))
compare_values (streamer_handle_as_builtin_p);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON)) if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
{ {
......
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