aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/gimple.c11
-rw-r--r--gcc/lto-symtab.c8
-rw-r--r--gcc/lto/ChangeLog4
-rw-r--r--gcc/lto/lto.c3
5 files changed, 31 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d6b9876..d6caa0c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2010-05-22 Richard Guenther <rguenther@suse.de>
+
+ * gimple.c (gimple_types_compatible_p): Check type qualifications
+ before merging pointer to complete and pointer to incomplete type.
+ * lto-symtab.c (lto_symtab_resolve_symbols): For commons make sure
+ we use our own resolution algorithm. The gold linker plugin
+ doesn't do the job we want it to do here.
+
2010-05-22 Anatoly Sokolov <aesok@post.ru>
* config/sparc/sparc.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 1ff9b3a..e5dc184 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3481,11 +3481,20 @@ gimple_types_compatible_p (tree t1, tree t2)
&& RECORD_OR_UNION_TYPE_P (TREE_TYPE (t1))
&& (!COMPLETE_TYPE_P (TREE_TYPE (t1))
|| !COMPLETE_TYPE_P (TREE_TYPE (t2)))
+ && TYPE_QUALS (TREE_TYPE (t1)) == TYPE_QUALS (TREE_TYPE (t2))
&& compare_type_names_p (TYPE_MAIN_VARIANT (TREE_TYPE (t1)),
TYPE_MAIN_VARIANT (TREE_TYPE (t2)), true))
{
/* Replace the pointed-to incomplete type with the
- complete one. */
+ complete one.
+ ??? This simple name-based merging causes at least some
+ of the ICEs in canonicalizing FIELD_DECLs during stmt
+ read. For example in GCC we have two different struct deps
+ and we mismatch the use in struct cpp_reader in sched-int.h
+ vs. mkdeps.c. Of course the whole exercise is for TBAA
+ with structs which contain pointers to incomplete types
+ in one unit and to complete ones in another. So we
+ probably should merge these types only with more context. */
if (COMPLETE_TYPE_P (TREE_TYPE (t2)))
TREE_TYPE (t1) = TREE_TYPE (t2);
else
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c
index 28e9aa3..f02824d 100644
--- a/gcc/lto-symtab.c
+++ b/gcc/lto-symtab.c
@@ -463,7 +463,13 @@ lto_symtab_resolve_symbols (void **slot)
if (TREE_CODE (e->decl) == FUNCTION_DECL)
e->node = cgraph_get_node (e->decl);
else if (TREE_CODE (e->decl) == VAR_DECL)
- e->vnode = varpool_get_node (e->decl);
+ {
+ e->vnode = varpool_get_node (e->decl);
+ /* The LTO plugin for gold doesn't handle common symbols
+ properly. Let us choose manually. */
+ if (DECL_COMMON (e->decl))
+ e->resolution = LDPR_UNKNOWN;
+ }
}
e = (lto_symtab_entry_t) *slot;
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 492cd61..83cfe3e 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,7 @@
+2010-05-22 Richard Guenther <rguenther@suse.de>
+
+ * lto.c (read_cgraph_and_symbols): Do not collect.
+
2010-05-20 Jan Hubicka <jh@suse.cz>
* lto.c (promote_var, promote_fn): New functions.
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 92fa4dd..d1ccc5a 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -1633,7 +1633,8 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
lto_obj_file_close (current_lto_file);
current_lto_file = NULL;
- ggc_collect ();
+ /* ??? We'd want but can't ggc_collect () here as the type merging
+ code in gimple.c uses hashtables that are not ggc aware. */
}
if (resolution_file_name)