From 17021bc8cbb9724e7cadb4984d11d5822e59df3a Mon Sep 17 00:00:00 2001
From: Richard Guenther <rguenther@suse.de>
Date: Sat, 28 Mar 2009 12:54:14 +0000
Subject: [PATCH] re PR tree-optimization/38458 (copy-propagation doesn't
 handle cycles)

2009-03-28  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/38458
	* tree-ssa-copy.c (copy_prop_visit_phi_node): For the first
	argument use the arguments copy-of value.

From-SVN: r145185
---
 gcc/ChangeLog       | 6 ++++++
 gcc/tree-ssa-copy.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4b746cdb319b..7e842a0c2630 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-28  Richard Guenther  <rguenther@suse.de>
+
+	PR tree-optimization/38458
+	* tree-ssa-copy.c (copy_prop_visit_phi_node): For the first
+	argument use the arguments copy-of value.
+
 2009-03-28  Richard Guenther  <rguenther@suse.de>
 
 	PR tree-optimization/38180
diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c
index 64c697a51968..8f060c2b5a20 100644
--- a/gcc/tree-ssa-copy.c
+++ b/gcc/tree-ssa-copy.c
@@ -892,7 +892,7 @@ copy_prop_visit_phi_node (gimple phi)
 	 memory reference of all the other arguments.  */
       if (phi_val.value == NULL_TREE)
 	{
-	  phi_val.value = arg;
+	  phi_val.value = arg_val->value;
 	  continue;
 	}
 
-- 
GitLab