aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-11-22 00:59:49 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2015-11-21 23:59:49 +0000
commitf85d24870891e785a86e1c394ca559953b262d2d (patch)
tree8ce584973badca7655229ceeb55de6f4eed7e8d7 /gcc/lto
parentfeb391fc5d47f7bd3860fe192a7a73531cbde77f (diff)
downloadgcc-f85d24870891e785a86e1c394ca559953b262d2d.zip
gcc-f85d24870891e785a86e1c394ca559953b262d2d.tar.gz
gcc-f85d24870891e785a86e1c394ca559953b262d2d.tar.bz2
lto.c (iterative_hash_canonical_type): Always recurse for pointers.
* lto.c (iterative_hash_canonical_type): Always recurse for pointers. (gimple_register_canonical_type_1): Check that pointers do not get canonical types. (gimple_register_canonical_type): Do not register pointers. * tree.c (build_pointer_type_for_mode,build_reference_type_for_mode): In LTO we do not compute TYPE_CANONICAL of pointers. (gimple_canonical_types_compatible_p): Improve coments; sanity check that pointers do not have canonical type that would make us believe they are different. * alias.c (get_alias_set): Do structural type equality on pointers; enable pointer path for LTO; also glob pointer to vector with pointer to vector element; glob pointers and references for LTO; do more strict sanity checking about build_pointer_type returning the canonical type which is also the main variant. (record_component_aliases): When component type is pointer and we do LTO; record void_type_node alias set. From-SVN: r230715
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog9
-rw-r--r--gcc/lto/lto.c13
2 files changed, 18 insertions, 4 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 49adea6..4105337 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,4 +1,11 @@
-2015-11-11 Jan Hubicka <hubicka@ucw.cz>
+2015-11-21 Jan Hubicka <hubicka@ucw.cz>
+
+ * lto.c (iterative_hash_canonical_type): Always recurse for pointers.
+ (gimple_register_canonical_type_1): Check that pointers do not get
+ canonical types.
+ (gimple_register_canonical_type): Do not register pointers.
+
+2015-11-21 Jan Hubicka <hubicka@ucw.cz>
* lto-symtab.c (warn_type_compatibility_p): Do not set ODR mismatch
flag for types that are not ODR; fix loop walking parameters.
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 36138e8..2661491 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -388,8 +388,13 @@ iterative_hash_canonical_type (tree type, inchash::hash &hstate)
/* All type variants have same TYPE_CANONICAL. */
type = TYPE_MAIN_VARIANT (type);
+
+ /* We do not compute TYPE_CANONICAl of POINTER_TYPE because the aliasing
+ code never use it anyway. */
+ if (POINTER_TYPE_P (type))
+ v = hash_canonical_type (type);
/* An already processed type. */
- if (TYPE_CANONICAL (type))
+ else if (TYPE_CANONICAL (type))
{
type = TYPE_CANONICAL (type);
v = gimple_canonical_type_hash (type);
@@ -437,7 +442,9 @@ gimple_register_canonical_type_1 (tree t, hashval_t hash)
{
void **slot;
- gcc_checking_assert (TYPE_P (t) && !TYPE_CANONICAL (t));
+ gcc_checking_assert (TYPE_P (t) && !TYPE_CANONICAL (t)
+ && type_with_alias_set_p (t)
+ && !POINTER_TYPE_P (t));
slot = htab_find_slot_with_hash (gimple_canonical_types, t, hash, INSERT);
if (*slot)
@@ -470,7 +477,7 @@ gimple_register_canonical_type_1 (tree t, hashval_t hash)
static void
gimple_register_canonical_type (tree t)
{
- if (TYPE_CANONICAL (t) || !type_with_alias_set_p (t))
+ if (TYPE_CANONICAL (t) || !type_with_alias_set_p (t) || POINTER_TYPE_P (t))
return;
/* Canonical types are same among all complete variants. */