diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 528ca321a56d08dd193522987ab3556dce4a05e6..dfbbb24c39305c67800eff5374d9090e3beecbf9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-06  Alexandre Oliva  <aoliva@redhat.com>
+
+	PR debug/42897
+	* gimple-iterator.c (gsi_remove): Propagate only PHI DEFs removed
+	permanently.
+
 2010-03-06  Alexandre Oliva  <aoliva@redhat.com>
 
 	PR debug/42897
diff --git a/gcc/gimple-iterator.c b/gcc/gimple-iterator.c
index 9a3c382606eb1ed04cffeb3eb5a8a2c0ca170d94..7d5d61009b92de3afcbbd7855e18ae725c166b4a 100644
--- a/gcc/gimple-iterator.c
+++ b/gcc/gimple-iterator.c
@@ -474,7 +474,8 @@ gsi_remove (gimple_stmt_iterator *i, bool remove_permanently)
   gimple_seq_node cur, next, prev;
   gimple stmt = gsi_stmt (*i);
 
-  insert_debug_temps_for_defs (i);
+  if (gimple_code (stmt) != GIMPLE_PHI)
+    insert_debug_temps_for_defs (i);
 
   /* Free all the data flow information for STMT.  */
   gimple_set_bb (stmt, NULL);
diff --git a/gcc/tree-phinodes.c b/gcc/tree-phinodes.c
index 6e63ed4f8f6121a2e17754df60d232815251803a..52aee785e806bedfc52aa02f474f1a3cf01d5b1c 100644
--- a/gcc/tree-phinodes.c
+++ b/gcc/tree-phinodes.c
@@ -473,6 +473,10 @@ void
 remove_phi_node (gimple_stmt_iterator *gsi, bool release_lhs_p)
 {
   gimple phi = gsi_stmt (*gsi);
+
+  if (release_lhs_p)
+    insert_debug_temps_for_defs (gsi);
+
   gsi_remove (gsi, false);
 
   /* If we are deleting the PHI node, then we should release the