diff options
author | Richard Guenther <rguenther@suse.de> | 2009-10-14 14:14:44 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-10-14 14:14:44 +0000 |
commit | 200c8750d65ebebc8a0d6f6f77a7f02b5a4a8ef3 (patch) | |
tree | 3d83178500a3538048d92b6df95e7c2182d671f7 /gcc/lto | |
parent | 77ce724c6b608989a50dd9ae86264ee0eec1b46a (diff) | |
download | gcc-200c8750d65ebebc8a0d6f6f77a7f02b5a4a8ef3.zip gcc-200c8750d65ebebc8a0d6f6f77a7f02b5a4a8ef3.tar.gz gcc-200c8750d65ebebc8a0d6f6f77a7f02b5a4a8ef3.tar.bz2 |
lto-symtab.c (lto_symtab_compatible): Fold in ...
2009-10-14 Richard Guenther <rguenther@suse.de>
* lto-symtab.c (lto_symtab_compatible): Fold in ...
(lto_symtab_merge): ... here. Rewrite both to take the
prevailing and a to-be-merged entry and to queue diagnostics
properly.
(lto_symtab_resolve_replaceable_p): New predicate for
symbol resolution.
(lto_symtab_resolve_can_prevail_p): Likewise.
(lto_symtab_resolve_symbols): Rewrite. Fold in code that
handles merging commons by choosing the largest decl. Fold
in code that gives ODR errors.
(lto_symtab_merge_decls_2): Simplify a lot. Emit queued
diagnostics here.
(lto_symtab_merge_decls_1): Re-structure. Deal with the
case of no prevailing decl here. Diagnose mismatches
in object types here. Drop all but the prevailing decls.
(lto_symtab_prevailing_decl): Return the single prevailing decl.
* lto-streamer-in.c (lto_input_tree_ref): Deal with
VIEW_CONVERT_EXPRs in decl slots. Unshare the tree in this case.
lto/
* lto.c (lto_fixup_tree): In case the prevailing decl is not
compatible with the one we replace wrap it around a
VIEW_CONVERT_EXPR.
From-SVN: r152768
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lto/lto.c | 10 |
2 files changed, 15 insertions, 1 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 82b8bec..e6f3e39 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2009-10-14 Richard Guenther <rguenther@suse.de> + + * lto.c (lto_fixup_tree): In case the prevailing decl is not + compatible with the one we replace wrap it around a + VIEW_CONVERT_EXPR. + 2009-10-09 Richard Guenther <rguenther@suse.de> PR lto/41635 diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 2b674c1..daca784 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -1530,10 +1530,18 @@ lto_fixup_tree (tree *tp, int *walk_subtrees, void *data) pointer_set_insert (fixup_data->free_list, t); + /* Replace the decl. If it is a not compatible VAR_DECL wrap + it inside a VIEW_CONVERT_EXPR. */ + if (TREE_CODE (*tp) == VAR_DECL + && !useless_type_conversion_p (TREE_TYPE (*tp), + TREE_TYPE (prevailing))) + *tp = build1 (VIEW_CONVERT_EXPR, TREE_TYPE (*tp), prevailing); + else + *tp = prevailing; + /* Also replace t with prevailing defintion. We don't want to insert the other defintion in the seen set as we want to replace all instances of it. */ - *tp = prevailing; t = prevailing; } } |