summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-22 22:03:04 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-22 22:03:04 +0000
commit0026572f4525f4ceeb00ef2bbb51086f6220ff30 (patch)
tree73849e0d621e9d0f68227345dc0752890782ddc8 /gcc
parent1a6a6dab8995efa3c744598000bd718fa0b81017 (diff)
downloadgcc-0026572f4525f4ceeb00ef2bbb51086f6220ff30.tar.gz
* typeck.c (expand_ptrmemfunc_cst): Scale idx down to an index
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
Diffstat (limited to 'gcc')
-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 b09e71f3737..87679b8fce5 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 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,