diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 65157e1dadfd9885ea71393c0e68241edcb7d2f9..7bd5402a3c173441e94a2ef021ae088995d487e5 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2013-01-31  Jason Merrill  <jason@redhat.com>
+
+	PR c++/56162
+	PR c++/56104
+	* typeck.c (get_member_function_from_ptrfunc): Fix
+	ptrmemfunc_vbit_in_delta case.
+
 2013-01-29  Jason Merrill  <jason@redhat.com>
 
 	PR libstdc++/54314
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index bfac39494e2a6c736f3f550ac4f52cdaac0c04d0..688c2665b4f90332db5bb202b4049f17d586942a 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -3176,9 +3176,7 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function,
       e3 = pfn_from_ptrmemfunc (function);
       delta = delta_from_ptrmemfunc (function);
       idx = build1 (NOP_EXPR, vtable_index_type, e3);
-      if (nonvirtual)
-	e1 = integer_zero_node;
-      else switch (TARGET_PTRMEMFUNC_VBIT_LOCATION)
+      switch (TARGET_PTRMEMFUNC_VBIT_LOCATION)
 	{
 	case ptrmemfunc_vbit_in_pfn:
 	  e1 = cp_build_binary_op (input_location,