diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-26 13:05:39 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-26 13:05:39 +0000 |
commit | 8da090de25c137d37dd64115b1d2fa26f02577d7 (patch) | |
tree | 74bf293401a0a1429a8339ebe33c9c46166e95f7 /gcc/tree-ssa-copyrename.c | |
parent | 2025948bd01df153e9f3c16bd1f70ab97c9327a1 (diff) | |
download | gcc-8da090de25c137d37dd64115b1d2fa26f02577d7.tar.gz |
2011-01-26 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 169285
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@169287 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-copyrename.c')
-rw-r--r-- | gcc/tree-ssa-copyrename.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/tree-ssa-copyrename.c b/gcc/tree-ssa-copyrename.c index 9c51d118384..dfc0b4edbbe 100644 --- a/gcc/tree-ssa-copyrename.c +++ b/gcc/tree-ssa-copyrename.c @@ -1,5 +1,5 @@ /* Rename SSA copies. - Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 + Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Andrew MacLeod <amacleod@redhat.com> @@ -170,7 +170,7 @@ copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug) return false; } - /* Never attempt to coalesce 2 difference parameters. */ + /* Never attempt to coalesce 2 different parameters. */ if (TREE_CODE (root1) == PARM_DECL && TREE_CODE (root2) == PARM_DECL) { if (debug) @@ -226,6 +226,18 @@ copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug) ign2 = false; } + /* Don't coalesce if the new chosen root variable would be read-only. + If both ign1 && ign2, then the root var of the larger partition + wins, so reject in that case if any of the root vars is TREE_READONLY. + Otherwise reject only if the root var, on which replace_ssa_name_symbol + will be called below, is readonly. */ + if ((TREE_READONLY (root1) && ign2) || (TREE_READONLY (root2) && ign1)) + { + if (debug) + fprintf (debug, " : Readonly variable. No coalesce.\n"); + return false; + } + /* 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 |