diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a0f0ce3a7390bdb6da4835d9da7f44e2287d217f..3c80308120fdb5db876ac9756be8539aeb839d9e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-16  Richard Guenther  <rguenther@suse.de>
+
+	* gimple.c (iterative_hash_gimple_type): For integer types
+	also hash their minimum and maximum values and the string flag.
+	For array types hash their domain and the string flag.
+
 2009-10-16  Richard Guenther  <rguenther@suse.de>
 
 	* gimple.c (gimple_types_compatible_p): Restrict completing
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 105fb1b60613792c08fdf88e32df690854e83713..fe8f156b4631e7acd84dba446c6a2b3240e2be43 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3688,7 +3688,24 @@ iterative_hash_gimple_type (tree type, hashval_t val,
 		   sccstack, sccstate, sccstate_obstack);
     }
 
-  /* Recurse for aggregates with a single element.  */
+  /* For integer types hash the types min/max values and the string flag.  */
+  if (TREE_CODE (type) == INTEGER_TYPE)
+    {
+      v = iterative_hash_expr (TYPE_MIN_VALUE (type), v);
+      v = iterative_hash_expr (TYPE_MAX_VALUE (type), v);
+      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))
+    {
+      v = iterative_hash_hashval_t (TYPE_STRING_FLAG (type), v);
+      v = visit (TYPE_DOMAIN (type), state, v,
+		 sccstack, sccstate, sccstate_obstack);
+    }
+
+  /* Recurse for aggregates with a single element type.  */
   if (TREE_CODE (type) == ARRAY_TYPE
       || TREE_CODE (type) == COMPLEX_TYPE
       || TREE_CODE (type) == VECTOR_TYPE)