diff options
author | Richard Guenther <rguenther@suse.de> | 2010-05-22 12:56:53 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-05-22 12:56:53 +0000 |
commit | bd9eb5dacc6e850014842b8f248a1c38c43a15a4 (patch) | |
tree | 75a0267d14937ac168a33af993b2c8c63ed5a1d2 /gcc/gimple.c | |
parent | 7c9b8fb912cdbac53aab302ab0e6b1b0831036df (diff) | |
download | gcc-bd9eb5dacc6e850014842b8f248a1c38c43a15a4.zip gcc-bd9eb5dacc6e850014842b8f248a1c38c43a15a4.tar.gz gcc-bd9eb5dacc6e850014842b8f248a1c38c43a15a4.tar.bz2 |
gimple.c (gimple_types_compatible_p): Check type qualifications before merging pointer to complete and pointer to...
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.
lto/
* lto.c (read_cgraph_and_symbols): Do not collect.
From-SVN: r159696
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r-- | gcc/gimple.c | 11 |
1 files changed, 10 insertions, 1 deletions
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 |