Index: lib/Frontend/CompilerInstance.cpp
===================================================================
--- lib/Frontend/CompilerInstance.cpp	(revision 146901)
+++ lib/Frontend/CompilerInstance.cpp	(working copy)
@@ -647,7 +647,16 @@
     llvm::EnableStatistics();
 
   for (unsigned i = 0, e = getFrontendOpts().Inputs.size(); i != e; ++i) {
-    const std::string &InFile = getFrontendOpts().Inputs[i].second;
+    // Ensure the input file path is absolute.  When generating AST files, the
+    // input file is recorded with an absolute path, but the original path
+    // will be used to perform a filesystem stat lookup which then gets cached
+    // in the AST file's stat cache using the original path.  When reading the
+    // AST file, the absolute path will be used to query the stat cache which
+    // reults in a cache miss and an actual stat of the filesystem.  The result
+    // is stat data that fails to match the data from the time of the compile.
+    // Always using an absolute path avoids this problem.
+    llvm::SmallString<128> InFile(getFrontendOpts().Inputs[i].second);
+    llvm::sys::fs::make_absolute(InFile);
 
     // Reset the ID tables if we are reusing the SourceManager.
     if (hasSourceManager())
