aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2013-05-10 13:15:14 +0200
committerMarc Glisse <glisse@gcc.gnu.org>2013-05-10 11:15:14 +0000
commita5e0cd1d9bd6fbcff37a6545d8e60b36ff6ea7a7 (patch)
tree28b2392d93f8ced83cd8e4d51d5232f6883088da /gcc/gimple.c
parentcb2558bc95658155c76e1468ed4db64359452dc2 (diff)
downloadgcc-a5e0cd1d9bd6fbcff37a6545d8e60b36ff6ea7a7.zip
gcc-a5e0cd1d9bd6fbcff37a6545d8e60b36ff6ea7a7.tar.gz
gcc-a5e0cd1d9bd6fbcff37a6545d8e60b36ff6ea7a7.tar.bz2
stor-layout.c (element_precision): New function.
2013-05-10 Marc Glisse <marc.glisse@inria.fr> gcc/ * stor-layout.c (element_precision): New function. * machmode.h (element_precision): Declare it. * tree.c (build_minus_one_cst): New function. (element_precision): Likewise. * tree.h (build_minus_one_cst): Declare new function. (element_precision): Likewise. * fold-const.c (operand_equal_p): Use element_precision. (fold_binary_loc): Handle vector types. * convert.c (convert_to_integer): Use element_precision. * gimple.c (iterative_hash_canonical_type): Handle complex and vectors separately. gcc/c-family/ * c-common.c (vector_types_convertible_p): No TYPE_PRECISION for vectors. gcc/testsuite/ * gcc.dg/vector-shift.c: New testcase. From-SVN: r198772
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 64f7b1a..f507419 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3083,8 +3083,6 @@ iterative_hash_canonical_type (tree type, hashval_t val)
if (INTEGRAL_TYPE_P (type)
|| SCALAR_FLOAT_TYPE_P (type)
|| FIXED_POINT_TYPE_P (type)
- || TREE_CODE (type) == VECTOR_TYPE
- || TREE_CODE (type) == COMPLEX_TYPE
|| TREE_CODE (type) == OFFSET_TYPE
|| POINTER_TYPE_P (type))
{
@@ -3092,6 +3090,15 @@ iterative_hash_canonical_type (tree type, hashval_t val)
v = iterative_hash_hashval_t (TYPE_UNSIGNED (type), v);
}
+ if (VECTOR_TYPE_P (type))
+ {
+ v = iterative_hash_hashval_t (TYPE_VECTOR_SUBPARTS (type), v);
+ v = iterative_hash_hashval_t (TYPE_UNSIGNED (type), v);
+ }
+
+ if (TREE_CODE (type) == COMPLEX_TYPE)
+ v = iterative_hash_hashval_t (TYPE_UNSIGNED (type), v);
+
/* For pointer and reference types, fold in information about the type
pointed to but do not recurse to the pointed-to type. */
if (POINTER_TYPE_P (type))