aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-sccvn.h
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-02-19 12:10:48 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-02-19 12:10:48 +0000
commit24d630163b15482845ffef8c733653281008016f (patch)
tree9b4aeec6f3f6f83ed0fdf40cc3955ca4432abfbf /gcc/tree-ssa-sccvn.h
parent47cc28f568eff9f93ad63ca2cb730b865232f441 (diff)
downloadgcc-24d630163b15482845ffef8c733653281008016f.zip
gcc-24d630163b15482845ffef8c733653281008016f.tar.gz
gcc-24d630163b15482845ffef8c733653281008016f.tar.bz2
re PR tree-optimization/56384 (ICE in fold_binary_loc, at fold-const.c:10422)
2013-02-19 Richard Biener <rguenther@suse.de> PR tree-optimization/56384 * tree-ssa-sccvn.h (struct vn_phi_s): Add type member. (vn_hash_type): Split out from ... (vn_hash_constant_with_type): ... here. * tree-ssa-sccvn.c (vn_phi_compute_hash): Use vn_hash_type. (vn_phi_eq): Compare types from vn_phi_s structure. (vn_phi_lookup): Populate vn_phi_s type. (vn_phi_insert): Likewise. * gcc.dg/torture/pr56384.c: New testcase. From-SVN: r196136
Diffstat (limited to 'gcc/tree-ssa-sccvn.h')
-rw-r--r--gcc/tree-ssa-sccvn.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/tree-ssa-sccvn.h b/gcc/tree-ssa-sccvn.h
index ea9020d..072f7dd 100644
--- a/gcc/tree-ssa-sccvn.h
+++ b/gcc/tree-ssa-sccvn.h
@@ -67,6 +67,7 @@ typedef struct vn_phi_s
hashval_t hashcode;
vec<tree> phiargs;
basic_block block;
+ tree type;
tree result;
} *vn_phi_t;
typedef const struct vn_phi_s *const_vn_phi_t;
@@ -122,17 +123,25 @@ typedef struct vn_constant_s
enum vn_kind { VN_NONE, VN_CONSTANT, VN_NARY, VN_REFERENCE, VN_PHI };
enum vn_kind vn_get_stmt_kind (gimple);
+/* Hash the type TYPE using bits that distinguishes it in the
+ types_compatible_p sense. */
+
+static inline hashval_t
+vn_hash_type (tree type)
+{
+ return (INTEGRAL_TYPE_P (type)
+ + (INTEGRAL_TYPE_P (type)
+ ? TYPE_PRECISION (type) + TYPE_UNSIGNED (type) : 0));
+}
+
/* Hash the constant CONSTANT with distinguishing type incompatible
constants in the types_compatible_p sense. */
static inline hashval_t
vn_hash_constant_with_type (tree constant)
{
- tree type = TREE_TYPE (constant);
return (iterative_hash_expr (constant, 0)
- + INTEGRAL_TYPE_P (type)
- + (INTEGRAL_TYPE_P (type)
- ? TYPE_PRECISION (type) + TYPE_UNSIGNED (type) : 0));
+ + vn_hash_type (TREE_TYPE (constant)));
}
/* Compare the constants C1 and C2 with distinguishing type incompatible