aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/lto/ChangeLog7
-rw-r--r--gcc/lto/lto-symtab.c9
-rw-r--r--gcc/lto/lto.c6
3 files changed, 15 insertions, 7 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 6f5ab78..56dcfa8 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,10 @@
+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>
* lto.h: Remove useless typedefs.
diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c
index 979579f..d50a1ab 100644
--- a/gcc/lto/lto-symtab.c
+++ b/gcc/lto/lto-symtab.c
@@ -798,11 +798,6 @@ lto_symtab_prevailing_decl (tree decl)
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_ABSTRACT_P (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. */
gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl));
@@ -811,5 +806,9 @@ lto_symtab_prevailing_decl (tree decl)
if (!ret)
return decl;
+ /* Do not replace a non-builtin with a builtin. */
+ if (is_builtin_fn (ret->decl))
+ return decl;
+
return ret->decl;
}
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 7ec4c08..b4287a3 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -1054,8 +1054,10 @@ compare_tree_sccs_1 (tree t1, tree t2, tree **map)
return false;
- /* We don't want to compare locations, so there is nothing do compare
- for TS_DECL_MINIMAL. */
+ /* We want to compare locations up to the point where it makes
+ 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))
{