diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2015-05-23 20:25:41 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-05-23 18:25:41 +0000 |
commit | b727ba74fbfb4fd944755de3a1f413d55ee8fbf1 (patch) | |
tree | 08d38493f2287d801a46fd580856d47488a4d38a /gcc/tree.c | |
parent | 1d1218fb65079b0ff98ea3b7ac9cbf3a73bcf772 (diff) | |
download | gcc-b727ba74fbfb4fd944755de3a1f413d55ee8fbf1.zip gcc-b727ba74fbfb4fd944755de3a1f413d55ee8fbf1.tar.gz gcc-b727ba74fbfb4fd944755de3a1f413d55ee8fbf1.tar.bz2 |
lto.c (hash_canonical_type): Be sure we hash only types that need alias set.
* lto.c (hash_canonical_type): Be sure we hash only types that
need alias set.
(gimple_register_canonical_type_1): Do not produce canonical
types for types that do not need alias sets.
* tree.c (gimple_canonical_types_compatible_p): Sanity check that
we do not try to compute canonical type for type that does not need
alias set.
(verify_type): Drop FIXME for METHOD_TYPE, update FIXME for
FUNCITON_TYPE.
* tree.h (type_with_alias_set_p): New.
From-SVN: r223608
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -12720,6 +12720,23 @@ gimple_canonical_types_compatible_p (const_tree t1, const_tree t2, if (t1 == NULL_TREE || t2 == NULL_TREE) return false; + /* We consider complete types always compatible with incomplete type. + This does not make sense for canonical type calculation and thus we + need to ensure that we are never called on it. + + FIXME: For more correctness the function probably should have three modes + 1) mode assuming that types are complete mathcing their structure + 2) mode allowing incomplete types but producing equivalence classes + and thus ignoring all info from complete types + 3) mode allowing incomplete types to match complete but checking + compatibility between complete types. + + 1 and 2 can be used for canonical type calculation. 3 is the real + definition of type compatibility that can be used i.e. for warnings during + declaration merging. */ + + gcc_assert (!trust_type_canonical + || (type_with_alias_set_p (t1) && type_with_alias_set_p (t2))); /* If the types have been previously registered and found equal they still are. */ if (TYPE_CANONICAL (t1) && TYPE_CANONICAL (t2) |