summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-23 19:09:04 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-23 19:09:04 +0000
commit02cf8dea688249d7c9e912804cd10338bfbbf3a3 (patch)
treeecdf742e02a29e89fac8e2bf8d4b3ff88317bbb9
parent068d7afb52872be089ab035941c723d045645d2a (diff)
downloadgcc-02cf8dea688249d7c9e912804cd10338bfbbf3a3.tar.gz
* gimple.c (gimple_types_compatible_p_1) <ARRAY_TYPE>: Remove bogus
size handling. (gimple_canonical_types_compatible_p) <ARRAY_TYPE>: Likewise. (iterative_hash_gimple_type): Adjust comment. (iterative_hash_canonical_type): Likewise. Hash the bounds of the domain for an array type instead of the domain type itself. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@187809 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/gimple.c33
2 files changed, 20 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f85264d5fc4..7c9cbcb22ae 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2012-05-23 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gimple.c (gimple_types_compatible_p_1) <ARRAY_TYPE>: Remove bogus
+ size handling.
+ (gimple_canonical_types_compatible_p) <ARRAY_TYPE>: Likewise.
+ (iterative_hash_gimple_type): Adjust comment.
+ (iterative_hash_canonical_type): Likewise. Hash the bounds of the
+ domain for an array type instead of the domain type itself.
+
2012-05-23 Georg-Johann Lay <avr@gjlay.de>
Backport from 2012-05-23 mainline r187803
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 3876912e471..79596a4ec9c 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3577,13 +3577,6 @@ gimple_types_compatible_p_1 (tree t1, tree t2, type_pair_t p,
goto same_types;
else if (i1 == NULL_TREE || i2 == NULL_TREE)
goto different_types;
- /* If for a complete array type the possibly gimplified sizes
- are different the types are different. */
- else if (((TYPE_SIZE (i1) != NULL) ^ (TYPE_SIZE (i2) != NULL))
- || (TYPE_SIZE (i1)
- && TYPE_SIZE (i2)
- && !operand_equal_p (TYPE_SIZE (i1), TYPE_SIZE (i2), 0)))
- goto different_types;
else
{
tree min1 = TYPE_MIN_VALUE (i1);
@@ -4095,9 +4088,8 @@ iterative_hash_gimple_type (tree type, hashval_t val,
v = iterative_hash_hashval_t (TYPE_STRING_FLAG (type), v);
}
- /* For array types hash their domain and the string flag. */
- if (TREE_CODE (type) == ARRAY_TYPE
- && TYPE_DOMAIN (type))
+ /* For array types hash the domain and the string flag. */
+ if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type))
{
v = iterative_hash_hashval_t (TYPE_STRING_FLAG (type), v);
v = visit (TYPE_DOMAIN (type), state, v,
@@ -4324,19 +4316,23 @@ iterative_hash_canonical_type (tree type, hashval_t val)
v = iterative_hash_hashval_t (TREE_CODE (TREE_TYPE (type)), v);
}
- /* For integer types hash the types min/max values and the string flag. */
+ /* For integer types hash the sizetype and the string flag. */
if (TREE_CODE (type) == INTEGER_TYPE)
{
v = iterative_hash_hashval_t (TYPE_STRING_FLAG (type), v);
v = iterative_hash_hashval_t (TYPE_IS_SIZETYPE (type), v);
}
- /* For array types hash their domain and the string flag. */
- if (TREE_CODE (type) == ARRAY_TYPE
- && TYPE_DOMAIN (type))
+ /* For array types hash the domain bounds and the string flag. */
+ if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type))
{
v = iterative_hash_hashval_t (TYPE_STRING_FLAG (type), v);
- v = iterative_hash_canonical_type (TYPE_DOMAIN (type), v);
+ /* OMP lowering can introduce error_mark_node in place of
+ random local decls in types. */
+ if (TYPE_MIN_VALUE (TYPE_DOMAIN (type)) != error_mark_node)
+ v = iterative_hash_expr (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), v);
+ if (TYPE_MAX_VALUE (TYPE_DOMAIN (type)) != error_mark_node)
+ v = iterative_hash_expr (TYPE_MAX_VALUE (TYPE_DOMAIN (type)), v);
}
/* Recurse for aggregates with a single element type. */
@@ -4605,13 +4601,6 @@ gimple_canonical_types_compatible_p (tree t1, tree t2)
return true;
else if (i1 == NULL_TREE || i2 == NULL_TREE)
return false;
- /* If for a complete array type the possibly gimplified sizes
- are different the types are different. */
- else if (((TYPE_SIZE (i1) != NULL) ^ (TYPE_SIZE (i2) != NULL))
- || (TYPE_SIZE (i1)
- && TYPE_SIZE (i2)
- && !operand_equal_p (TYPE_SIZE (i1), TYPE_SIZE (i2), 0)))
- return false;
else
{
tree min1 = TYPE_MIN_VALUE (i1);