* typeck.c (expand_ptrmemfunc_cst): Scale idx down to an index
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Mar 2002 22:03:04 +0000 (22:03 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Mar 2002 22:03:04 +0000 (22:03 +0000)
into the vtable_entry array regardless of
TARGET_PTRMEMFUNC_VBIT_LOCATION.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51192 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/typeck.c

index b09e71f..87679b8 100644 (file)
@@ -1,3 +1,9 @@
+2002-03-22  Jeff Knaggs  <jknaggs@redhat.com>
+
+       * typeck.c (expand_ptrmemfunc_cst): Scale idx down to an index
+       into the vtable_entry array regardless of
+       TARGET_PTRMEMFUNC_VBIT_LOCATION.
+
 2002-03-21  Aldy Hernandez  <aldyh@redhat.com>
 
         * tree.c (cp_cannot_inline_tree_fn): Same.
index f0c9255..767f90d 100644 (file)
@@ -2890,19 +2890,18 @@ get_member_function_from_ptrfunc (instance_ptrptr, function)
         load-with-sign-extend, while the second used normal load then
         shift to sign-extend.  An optimizer flaw, perhaps, but it's
         easier to make this change.  */
+      idx = cp_build_binary_op (TRUNC_DIV_EXPR, 
+                               build1 (NOP_EXPR, vtable_index_type, e3),
+                               TYPE_SIZE_UNIT (vtable_entry_type));
       switch (TARGET_PTRMEMFUNC_VBIT_LOCATION)
        {
        case ptrmemfunc_vbit_in_pfn:
-         idx = cp_build_binary_op (TRUNC_DIV_EXPR, 
-                                   build1 (NOP_EXPR, vtable_index_type, e3),
-                                   TYPE_SIZE_UNIT (vtable_entry_type));
          e1 = cp_build_binary_op (BIT_AND_EXPR,
                                   build1 (NOP_EXPR, vtable_index_type, e3),
                                   integer_one_node);
          break;
 
        case ptrmemfunc_vbit_in_delta:
-         idx = build1 (NOP_EXPR, vtable_index_type, e3);
          e1 = cp_build_binary_op (BIT_AND_EXPR,
                                   delta, integer_one_node);
          delta = cp_build_binary_op (RSHIFT_EXPR,