diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-08-31 11:48:11 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-08-31 11:48:11 +0000 |
commit | a4e1a24dd9c1ecc668780f572fa335f9e0972b64 (patch) | |
tree | cfb9a962ef757505f7618678eb1167a6ab46af2c | |
parent | ac07ea08a06da35896dc027dee20fed0af72f350 (diff) | |
download | gcc-a4e1a24dd9c1ecc668780f572fa335f9e0972b64.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227339 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/lto/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/lto/lto-symtab.c | 9 | ||||
-rw-r--r-- | gcc/lto/lto.c | 6 |
3 files changed, 15 insertions, 7 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 6f5ab78ca45..56dcfa8f3c0 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 979579f4f16..d50a1abd3a0 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 7ec4c08a39e..b4287a358f8 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)) { |