Patchwork C++ PATCH for c++/56162 (pmf1.C failure on arm)

login
register
mail settings
Submitter Jason Merrill
Date Jan. 31, 2013, 3:22 p.m.
Message ID <510A8C44.9060004@redhat.com>
Download mbox | patch
Permalink /patch/217199/
State New
Headers show

Comments

Jason Merrill - Jan. 31, 2013, 3:22 p.m.
In my 56104 patch I failed to notice that in the ARM (vbit in delta) 
case, we need to adjust the delta even if we know we're doing a 
non-virtual call.

Tested x86_64-pc-linux-gnu, applying to trunk.

Patch

commit 6a52d34876377448990d550cb763171180f44444
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Jan 31 09:45:49 2013 -0500

    	PR c++/56162
    	PR c++/56104
    	* typeck.c (get_member_function_from_ptrfunc): Fix
    	ptrmemfunc_vbit_in_delta case.

diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index bfac394..688c266 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,