Index: test/SemaCXX/conversion.cpp
===================================================================
--- test/SemaCXX/conversion.cpp	(revision 140724)
+++ test/SemaCXX/conversion.cpp	(working copy)
@@ -60,4 +60,5 @@
   int c = ((((NULL)))); // expected-warning {{implicit conversion of NULL constant to integer}}
   int d;
   d = ((((NULL)))); // expected-warning {{implicit conversion of NULL constant to integer}}
+  long e = NULL; // expected-warning {{implicit conversion of NULL constant to integer}}
 }
Index: lib/Sema/SemaChecking.cpp
===================================================================
--- lib/Sema/SemaChecking.cpp	(revision 140775)
+++ lib/Sema/SemaChecking.cpp	(working copy)
@@ -3224,6 +3224,15 @@
                              SourceLocation CC, bool *ICContext = 0) {
   if (E->isTypeDependent() || E->isValueDependent()) return;
 
+  if (isa<GNUNullExpr>(E) && T.getTypePtr()->isIntegerType()) {
+    S.Diag(E->getExprLoc(), diag::warn_impcast_null_pointer_to_integer)
+        << E->getSourceRange() << clang::SourceRange(CC);
+    return;
+  }
+
+  if (E->getType() == T)
+    return;
+
   const Type *Source = S.Context.getCanonicalType(E->getType()).getTypePtr();
   const Type *Target = S.Context.getCanonicalType(T).getTypePtr();
   if (Source == Target) return;
@@ -3332,13 +3341,6 @@
   if (!Source->isIntegerType() || !Target->isIntegerType())
     return;
 
-  if ((E->isNullPointerConstant(S.Context, Expr::NPC_ValueDependentIsNotNull)
-           == Expr::NPCK_GNUNull) && Target->isIntegerType()) {
-    S.Diag(E->getExprLoc(), diag::warn_impcast_null_pointer_to_integer)
-        << E->getSourceRange() << clang::SourceRange(CC);
-    return;
-  }
-
   IntRange SourceRange = GetExprRange(S.Context, E);
   IntRange TargetRange = IntRange::forTargetOfCanonicalType(S.Context, Target);
 
@@ -3481,10 +3483,7 @@
   }
 
   // Go ahead and check any implicit conversions we might have skipped.
-  // The non-canonical typecheck is just an optimization;
-  // CheckImplicitConversion will filter out dead implicit conversions.
-  if (E->getType() != T)
-    CheckImplicitConversion(S, E, T, CC);
+  CheckImplicitConversion(S, E, T, CC);
 
   // Now continue drilling into this expression.
 
