Index: test/Sema/warn-unreachable.c
===================================================================
--- test/Sema/warn-unreachable.c	(revision 117209)
+++ test/Sema/warn-unreachable.c	(working copy)
@@ -35,8 +35,8 @@
       dead();   // expected-warning {{will never be executed}}
 
   case 3:
-  live()        // expected-warning {{will never be executed}}
-    +           
+  live()
+    +           // expected-warning {{will never be executed}}
     halt();
   dead();
 
@@ -75,8 +75,8 @@
     goto c6;
   case 7:
     halt()
-      +         // expected-warning {{will never be executed}}
-      dead();
+      +
+      dead();   // expected-warning {{will never be executed}}
     -           // expected-warning {{will never be executed}}
       halt();
   case 8:
Index: lib/Analysis/CFG.cpp
===================================================================
--- lib/Analysis/CFG.cpp	(revision 117209)
+++ lib/Analysis/CFG.cpp	(working copy)
@@ -912,15 +912,17 @@
       AppendStmt(Block, B, asc);
     }
 
-    // If visiting RHS causes us to finish 'Block' and the LHS doesn't
-    // create a new block, then we should return RBlock.  Otherwise
-    // we'll incorrectly return NULL.
-    CFGBlock *RBlock = Visit(B->getRHS());
-    CFGBlock *LBlock = Visit(B->getLHS(), AddStmtChoice::AsLValueNotAlwaysAdd);
-    return LBlock ? LBlock : RBlock;
+    Visit(B->getLHS(), AddStmtChoice::AsLValueNotAlwaysAdd);
+    return Visit(B->getRHS());
   }
 
-  return VisitStmt(B, asc);
+  if (asc.alwaysAdd()) {
+    autoCreateBlock();
+    AppendStmt(Block, B, asc);
+  }
+
+  Visit(B->getRHS());
+  return Visit(B->getLHS());
 }
 
 CFGBlock *CFGBuilder::VisitBlockExpr(BlockExpr *E, AddStmtChoice asc) {
