Commit 0370b27c by Eric Botcazou Committed by Eric Botcazou

tree.c (build_range_type_1): Do not SET_TYPE_STRUCTURAL_EQUALITY for a non-shared type.

	* tree.c (build_range_type_1): Do not SET_TYPE_STRUCTURAL_EQUALITY
	for a non-shared type.

From-SVN: r167393
parent 4aa9afb4
2010-12-02 Eric Botcazou <ebotcazou@adacore.com>
* tree.c (build_range_type_1): Do not SET_TYPE_STRUCTURAL_EQUALITY
for a non-shared type.
2010-12-02 Sebastian Pop <sebastian.pop@amd.com> 2010-12-02 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/45297 PR middle-end/45297
...@@ -7096,6 +7096,7 @@ static tree ...@@ -7096,6 +7096,7 @@ static tree
build_range_type_1 (tree type, tree lowval, tree highval, bool shared) build_range_type_1 (tree type, tree lowval, tree highval, bool shared)
{ {
tree itype = make_node (INTEGER_TYPE); tree itype = make_node (INTEGER_TYPE);
hashval_t hashcode = 0;
TREE_TYPE (itype) = type; TREE_TYPE (itype) = type;
...@@ -7109,6 +7110,9 @@ build_range_type_1 (tree type, tree lowval, tree highval, bool shared) ...@@ -7109,6 +7110,9 @@ build_range_type_1 (tree type, tree lowval, tree highval, bool shared)
TYPE_ALIGN (itype) = TYPE_ALIGN (type); TYPE_ALIGN (itype) = TYPE_ALIGN (type);
TYPE_USER_ALIGN (itype) = TYPE_USER_ALIGN (type); TYPE_USER_ALIGN (itype) = TYPE_USER_ALIGN (type);
if (!shared)
return itype;
if ((TYPE_MIN_VALUE (itype) if ((TYPE_MIN_VALUE (itype)
&& TREE_CODE (TYPE_MIN_VALUE (itype)) != INTEGER_CST) && TREE_CODE (TYPE_MIN_VALUE (itype)) != INTEGER_CST)
|| (TYPE_MAX_VALUE (itype) || (TYPE_MAX_VALUE (itype)
...@@ -7120,13 +7124,10 @@ build_range_type_1 (tree type, tree lowval, tree highval, bool shared) ...@@ -7120,13 +7124,10 @@ build_range_type_1 (tree type, tree lowval, tree highval, bool shared)
return itype; return itype;
} }
if (shared) hashcode = iterative_hash_expr (TYPE_MIN_VALUE (itype), hashcode);
{ hashcode = iterative_hash_expr (TYPE_MAX_VALUE (itype), hashcode);
hashval_t hash = iterative_hash_expr (TYPE_MIN_VALUE (itype), 0); hashcode = iterative_hash_hashval_t (TYPE_HASH (type), hashcode);
hash = iterative_hash_expr (TYPE_MAX_VALUE (itype), hash); itype = type_hash_canon (hashcode, itype);
hash = iterative_hash_hashval_t (TYPE_HASH (type), hash);
itype = type_hash_canon (hash, itype);
}
return itype; return itype;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment