aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-08-03 10:30:46 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-08-03 10:30:46 +0000
commit907dd6ae395ec223ca3a410d199cac3a346ef8db (patch)
tree9149c79a96270471123654308ed9bc5256fbf44b /gcc/tree.c
parent2329c6f56d3724a337ed9dfcf5f0e7412a1406d8 (diff)
downloadgcc-907dd6ae395ec223ca3a410d199cac3a346ef8db.zip
gcc-907dd6ae395ec223ca3a410d199cac3a346ef8db.tar.gz
gcc-907dd6ae395ec223ca3a410d199cac3a346ef8db.tar.bz2
tree.c (make_vector_type): Build a main variant first, get the canonical one and then build the variant.
2009-08-03 Richard Guenther <rguenther@suse.de> * tree.c (make_vector_type): Build a main variant first, get the canonical one and then build the variant. * tree-ssa.c (useless_type_conversion_p_1): Handle fixed-point types. (useless_type_conversion_p): Conversions to pointers to incomplete record types are useless. From-SVN: r150370
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 44178af..58994b1 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -7686,21 +7686,10 @@ make_vector_type (tree innertype, int nunits, enum machine_mode mode)
tree t;
hashval_t hashcode = 0;
- /* Build a main variant, based on the main variant of the inner type, then
- use it to build the variant we return. */
- if ((TYPE_ATTRIBUTES (innertype) || TYPE_QUALS (innertype))
- && TYPE_MAIN_VARIANT (innertype) != innertype)
- return build_type_attribute_qual_variant (
- make_vector_type (TYPE_MAIN_VARIANT (innertype), nunits, mode),
- TYPE_ATTRIBUTES (innertype),
- TYPE_QUALS (innertype));
-
t = make_node (VECTOR_TYPE);
TREE_TYPE (t) = TYPE_MAIN_VARIANT (innertype);
SET_TYPE_VECTOR_SUBPARTS (t, nunits);
SET_TYPE_MODE (t, mode);
- TYPE_READONLY (t) = TYPE_READONLY (innertype);
- TYPE_VOLATILE (t) = TYPE_VOLATILE (innertype);
if (TYPE_STRUCTURAL_EQUALITY_P (innertype))
SET_TYPE_STRUCTURAL_EQUALITY (t);
@@ -7730,9 +7719,20 @@ make_vector_type (tree innertype, int nunits, enum machine_mode mode)
}
hashcode = iterative_hash_host_wide_int (VECTOR_TYPE, hashcode);
+ hashcode = iterative_hash_host_wide_int (nunits, hashcode);
hashcode = iterative_hash_host_wide_int (mode, hashcode);
- hashcode = iterative_hash_object (TYPE_HASH (innertype), hashcode);
- return type_hash_canon (hashcode, t);
+ hashcode = iterative_hash_object (TYPE_HASH (TREE_TYPE (t)), hashcode);
+ t = type_hash_canon (hashcode, t);
+
+ /* We have built a main variant, based on the main variant of the
+ inner type. Use it to build the variant we return. */
+ if ((TYPE_ATTRIBUTES (innertype) || TYPE_QUALS (innertype))
+ && TREE_TYPE (t) != innertype)
+ return build_type_attribute_qual_variant (t,
+ TYPE_ATTRIBUTES (innertype),
+ TYPE_QUALS (innertype));
+
+ return t;
}
static tree