2010-12-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46806
* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Do not
coalesce different types.
* g++.dg/torture/
20100825.C: New testcase.
From-SVN: r167490
+2010-12-06 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/46806
+ * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Do not
+ coalesce different types.
+
2010-12-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46785
+2010-12-06 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/46806
+ * g++.dg/torture/20100825.C: New testcase.
+
2010-12-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/46785
--- /dev/null
+// { dg-do run }
+
+typedef enum { zero = 0, one = 1, two = 2, ENUM_MAX = 3 } my_enum;
+my_enum e;
+extern "C" void abort (void);
+int __attribute__((noinline)) foo() { return 10; }
+int main()
+{
+ int r;
+ r = foo();
+ if ((r < 0) || (r >= ENUM_MAX))
+ return 0;
+ e = (my_enum)r;
+ abort ();
+}
ign2 = false;
}
- /* Don't coalesce if the two variables aren't type compatible. */
- if (!types_compatible_p (TREE_TYPE (root1), TREE_TYPE (root2)))
+ /* Don't coalesce if the two variables are not of the same type. */
+ if (TREE_TYPE (root1) != TREE_TYPE (root2))
{
if (debug)
- fprintf (debug, " : Incompatible types. No coalesce.\n");
+ fprintf (debug, " : Different types. No coalesce.\n");
return false;
}