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.h | |
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.h')
-rw-r--r-- | gcc/tree.h | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -5090,6 +5090,26 @@ int_bit_position (const_tree field) + wi::to_offset (DECL_FIELD_BIT_OFFSET (field))).to_shwi (); } +/* Return true if it makes sense to consider alias set for a type T. */ + +inline bool +type_with_alias_set_p (const_tree t) +{ + /* Function and method types are never accessed as memory locations. */ + if (TREE_CODE (t) == FUNCTION_TYPE || TREE_CODE (t) == METHOD_TYPE) + return false; + + if (COMPLETE_TYPE_P (t)) + return true; + + /* Incomplete types can not be accessed in general except for arrays + where we can fetch its element despite we have no array bounds. */ + if (TREE_CODE (t) == ARRAY_TYPE && COMPLETE_TYPE_P (TREE_TYPE (t))) + return true; + + return false; +} + extern void gt_ggc_mx (tree &); extern void gt_pch_nx (tree &); extern void gt_pch_nx (tree &, gt_pointer_operator, void *); |