+2011-01-20 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47167
+ * tree-ssa-copyrename.c (copy_rename_partition_coalesce):
+ Revert previous change, only avoid enumeral type changes.
+
2011-01-17 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline
ign2 = false;
}
- /* Don't coalesce if the two variables are not of the same type. */
- if (TREE_TYPE (root1) != TREE_TYPE (root2))
+ /* Don't coalesce if the two variables aren't type compatible . */
+ if (!types_compatible_p (TREE_TYPE (root1), TREE_TYPE (root2))
+ /* There is a disconnect between the middle-end type-system and
+ VRP, avoid coalescing enum types with different bounds. */
+ || ((TREE_CODE (TREE_TYPE (root1)) == ENUMERAL_TYPE
+ || TREE_CODE (TREE_TYPE (root2)) == ENUMERAL_TYPE)
+ && TREE_TYPE (root1) != TREE_TYPE (root2)))
{
if (debug)
- fprintf (debug, " : Different types. No coalesce.\n");
+ fprintf (debug, " : Incompatible types. No coalesce.\n");
return false;
}