diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-12-02 22:02:30 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-12-02 22:02:30 +0000 |
commit | 0370b27c1615d53a412872881bf9581e590b55fb (patch) | |
tree | 4707bd0b11d69f2645fde2f8ffd49d873abd7815 | |
parent | 4aa9afb41f6c68620efc35697c00bbd60b3ba460 (diff) | |
download | gcc-0370b27c1615d53a412872881bf9581e590b55fb.zip gcc-0370b27c1615d53a412872881bf9581e590b55fb.tar.gz gcc-0370b27c1615d53a412872881bf9581e590b55fb.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree.c | 15 |
2 files changed, 13 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ec354d6..5bcef5d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +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> PR middle-end/45297 @@ -7096,6 +7096,7 @@ static tree build_range_type_1 (tree type, tree lowval, tree highval, bool shared) { tree itype = make_node (INTEGER_TYPE); + hashval_t hashcode = 0; TREE_TYPE (itype) = type; @@ -7109,6 +7110,9 @@ build_range_type_1 (tree type, tree lowval, tree highval, bool shared) TYPE_ALIGN (itype) = TYPE_ALIGN (type); TYPE_USER_ALIGN (itype) = TYPE_USER_ALIGN (type); + if (!shared) + return itype; + if ((TYPE_MIN_VALUE (itype) && TREE_CODE (TYPE_MIN_VALUE (itype)) != INTEGER_CST) || (TYPE_MAX_VALUE (itype) @@ -7120,13 +7124,10 @@ build_range_type_1 (tree type, tree lowval, tree highval, bool shared) return itype; } - if (shared) - { - hashval_t hash = iterative_hash_expr (TYPE_MIN_VALUE (itype), 0); - hash = iterative_hash_expr (TYPE_MAX_VALUE (itype), hash); - hash = iterative_hash_hashval_t (TYPE_HASH (type), hash); - itype = type_hash_canon (hash, itype); - } + hashcode = iterative_hash_expr (TYPE_MIN_VALUE (itype), hashcode); + hashcode = iterative_hash_expr (TYPE_MAX_VALUE (itype), hashcode); + hashcode = iterative_hash_hashval_t (TYPE_HASH (type), hashcode); + itype = type_hash_canon (hashcode, itype); return itype; } |