aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Knaggs <jknaggs@redhat.com>2002-03-22 22:03:04 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2002-03-22 22:03:04 +0000
commit9181f8db39ecfa09bf38f8df8c59eddb3a0886cc (patch)
tree73849e0d621e9d0f68227345dc0752890782ddc8
parent7f48c9e1504132e59676f4fda5c61fd26c293f52 (diff)
downloadgcc-9181f8db39ecfa09bf38f8df8c59eddb3a0886cc.zip
gcc-9181f8db39ecfa09bf38f8df8c59eddb3a0886cc.tar.gz
gcc-9181f8db39ecfa09bf38f8df8c59eddb3a0886cc.tar.bz2
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
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/typeck.c7
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b09e71f..87679b8 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index f0c9255..767f90d 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,