From: Richard Guenther Date: Thu, 20 Jan 2011 10:36:29 +0000 (+0000) Subject: re PR other/47167 (Performance regression in numerical code) X-Git-Tag: releases/gcc-4.5.3~288 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11ddf2cbf47b3c585410b8bf2d87d3c2545bbce9;p=thirdparty%2Fgcc.git re PR other/47167 (Performance regression in numerical code) 2011-01-20 Richard Guenther PR tree-optimization/47167 * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Revert previous change, only avoid enumeral type changes. From-SVN: r169051 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7dc8d42d549f..00d949d7c7c8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-01-20 Richard Guenther + + 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 Backport from mainline diff --git a/gcc/tree-ssa-copyrename.c b/gcc/tree-ssa-copyrename.c index 8baef94a204e..4eb6a38011e8 100644 --- a/gcc/tree-ssa-copyrename.c +++ b/gcc/tree-ssa-copyrename.c @@ -225,11 +225,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; }