class.c (build_vtbl_initializer): Add cast.
authorSteve Ellcey <sje@cup.hp.com>
Mon, 30 Sep 2002 18:06:58 +0000 (18:06 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Mon, 30 Sep 2002 18:06:58 +0000 (18:06 +0000)
* class.c (build_vtbl_initializer): Add cast.
(add_vcall_offset_vtbl_entries_1):
Use TARGET_VTABLE_DATA_ENTRY_DISTANCE for offset.

From-SVN: r57659

gcc/cp/ChangeLog
gcc/cp/class.c

index 1fef98d22b821048453f4154ea408e8b4157d16f..c3690f3dca1bc7ae987764dba5886a8dbe3c86f2 100644 (file)
@@ -1,3 +1,9 @@
+2002-09-30  Steve Ellcey  <sje@cup.hp.com>
+
+       * class.c (build_vtbl_initializer): Add cast.
+       (add_vcall_offset_vtbl_entries_1):
+       Use TARGET_VTABLE_DATA_ENTRY_DISTANCE for offset.
+
 2002-09-30  Mark Mitchell  <mark@codesourcery.com>
 
        * class.c (walk_subobject_offsets): Correct the calculation of
index b97b2683ee169fa0005ce8767a78c05cbaf16dc1..5d46eaa3c4e5e9f5a14f0a3d3c25fb45690d2f38 100644 (file)
@@ -7616,7 +7616,10 @@ build_vtbl_initializer (binfo, orig_binfo, t, rtti_binfo, non_fn_entries_p)
          int i;
 
          for (i = 1; i < TARGET_VTABLE_DATA_ENTRY_DISTANCE; ++i)
-           add = tree_cons (NULL_TREE, null_pointer_node, add);
+           add = tree_cons (NULL_TREE,
+                            build_c_cast (vtable_entry_type,
+                                    size_zero_node),
+                            add);
          *prev = add;
        }
     }
@@ -8061,7 +8064,8 @@ add_vcall_offset_vtbl_entries_1 (binfo, vid)
 
       /* The next vcall offset will be found at a more negative
         offset.  */
-      vid->index = size_binop (MINUS_EXPR, vid->index, ssize_int (1));
+      vid->index = size_binop (MINUS_EXPR, vid->index,
+                              ssize_int (TARGET_VTABLE_DATA_ENTRY_DISTANCE));
 
       /* Keep track of this function.  */
       VARRAY_PUSH_TREE (vid->fns, derived_virtuals);