From: Jeff Knaggs Date: Fri, 22 Mar 2002 22:03:04 +0000 (+0000) Subject: typeck.c (expand_ptrmemfunc_cst): Scale idx down to an index into the vtable_entry... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9181f8db39ecfa09bf38f8df8c59eddb3a0886cc;p=gcc.git typeck.c (expand_ptrmemfunc_cst): Scale idx down to an index into the vtable_entry array regardless of... * typeck.c (expand_ptrmemfunc_cst): Scale idx down to an index into the vtable_entry array regardless of TARGET_PTRMEMFUNC_VBIT_LOCATION. From-SVN: r51192 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b09e71f3737..87679b8fce5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2002-03-22 Jeff Knaggs + + * 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 * tree.c (cp_cannot_inline_tree_fn): Same. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index f0c9255e978..767f90d72cb 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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,