summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-copyrename.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-20 10:33:15 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-20 10:33:15 +0000
commit34d5f36dee8fbac95a28fb1587c87c6669406343 (patch)
tree8941373d666fd609a025decd10e84016c5d9462c /gcc/tree-ssa-copyrename.c
parentb56a5220a4749d7ef4e43600aa2454d782590720 (diff)
downloadgcc-34d5f36dee8fbac95a28fb1587c87c6669406343.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169050 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-copyrename.c')
-rw-r--r--gcc/tree-ssa-copyrename.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/tree-ssa-copyrename.c b/gcc/tree-ssa-copyrename.c
index abee6b9407f..9c51d118384 100644
--- a/gcc/tree-ssa-copyrename.c
+++ b/gcc/tree-ssa-copyrename.c
@@ -226,11 +226,16 @@ copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug)
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;
}