diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8f91736fdc9b89d62a3d0074b4251f669862f4dd..e344f9eff14876af2acd464761f184af51637ddb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-08  Daniel Berlin  <dberlin@dberlin.org>
+
+	* tree.h (tree_memory_tag): Add old_used_alone.
+	(SMT_OLD_USED_ALONE): New macro.
+	* tree-ssa-alias.c (recalculate_used_alone): Stop
+	marking things for renaming unnecessarily.
+
 2006-04-08  Kazu Hirata  <kazu@codesourcery.com>
 
 	* builtins.c, config/arm/arm.c, config/i386/cygwin.h,
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index f0d16d452a6a3f6919627908a73249fbb2f93cf8..3ad4b0ffe1c0e8090e67eea5cfd614296a968646 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -443,7 +443,10 @@ recalculate_used_alone (void)
   updating_used_alone = true;
   FOR_EACH_REFERENCED_VAR (var, rvi)
     if (TREE_CODE (var) == SYMBOL_MEMORY_TAG)
-      SMT_USED_ALONE (var) = 0;
+      {
+	SMT_OLD_USED_ALONE (var) = SMT_USED_ALONE (var);
+	SMT_USED_ALONE (var) = 0;
+      }
 
   /* Walk all the statements.
      Calls get put into a list of statements to update, since we will
@@ -476,7 +479,11 @@ recalculate_used_alone (void)
 		      if (!SMT_USED_ALONE (svar))
 			{
 			  SMT_USED_ALONE (svar) = true;
-			  mark_sym_for_renaming (svar);
+
+			  /* Only need to mark for renaming if it wasn't
+			     used alone before.  */
+			  if (!SMT_OLD_USED_ALONE (svar))
+			    mark_sym_for_renaming (svar);
 			}
 		    }
 		}
diff --git a/gcc/tree.h b/gcc/tree.h
index 27f4b0fd76abd10c93951952cb89065a351e7f85..b3bc004f4c5a4eb5ef995cf595998721d00cdcce 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2312,6 +2312,7 @@ struct tree_memory_tag GTY(())
   struct tree_decl_minimal common;
   unsigned int is_global:1;
   unsigned int is_used_alone:1;
+  unsigned int old_used_alone:1;
 };
 
 #define MTAG_GLOBAL(NODE) (TREE_MEMORY_TAG_CHECK (NODE)->mtag.is_global)
@@ -2321,6 +2322,11 @@ struct tree_memory_tag GTY(())
    from it.  */
 #define SMT_USED_ALONE(NODE) (SYMBOL_MEMORY_TAG_CHECK (NODE)->mtag.is_used_alone)
 
+/* This flag is used to temporarily store the old value of the used alone
+   flag when updating so we know whether to mark the symbol for
+   renaming.  */
+#define SMT_OLD_USED_ALONE(NODE) (SYMBOL_MEMORY_TAG_CHECK (NODE)->mtag.old_used_alone)
+
 struct tree_struct_field_tag GTY(())
 {
   struct tree_memory_tag common;