Index: tree-inline.c
===================================================================
--- tree-inline.c	(revision 161371)
+++ tree-inline.c	(working copy)
@@ -234,6 +234,7 @@ remap_ssa_name (tree name, copy_body_dat
 	     regions of the CFG, but this is expensive to test.  */
 	  if (id->entry_bb
 	      && is_gimple_reg (SSA_NAME_VAR (name))
+	      && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name)
 	      && TREE_CODE (SSA_NAME_VAR (name)) != PARM_DECL
 	      && (id->entry_bb != EDGE_SUCC (ENTRY_BLOCK_PTR, 0)->dest
 		  || EDGE_COUNT (id->entry_bb->preds) != 1))
Index: testsuite/gcc.dg/uninit-17.c
===================================================================
--- testsuite/gcc.dg/uninit-17.c	(revision 0)
+++ testsuite/gcc.dg/uninit-17.c	(revision 0)
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+inline int foo(int x)
+{
+  return x;
+}
+static void bar(int a, int *ptr)
+{
+  do
+  {
+    int b;
+    if (b < 40) {
+      ptr[0] = b; /* { dg-warning "may be used uninitialized" } */
+    }
+    b += 1;
+    ptr++;
+  }
+  while (--a != 0);
+}
+void foobar(int a, int *ptr)
+{
+  bar(foo(a), ptr);
+}
+
+/* { dg-message "note: '\[^\n'\]*' was declared here" "note: expected" { target *-*-* } 0 } */
