diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2000-03-17 17:31:58 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2000-03-17 12:31:58 -0500 |
commit | 665f250366b2cd1528c32b0d7d2fea6aae006e85 (patch) | |
tree | 0d31e5a8b4d8432cfb9d20e84ce3b4a97056fdf0 /gcc/cp | |
parent | 63f034bfe3afe558171d79c95166e3e86ee2c515 (diff) | |
download | gcc-665f250366b2cd1528c32b0d7d2fea6aae006e85.zip gcc-665f250366b2cd1528c32b0d7d2fea6aae006e85.tar.gz gcc-665f250366b2cd1528c32b0d7d2fea6aae006e85.tar.bz2 |
* Clean up usages of TREE_INT_CST_LOW.
* c-parse.in (RESTORE_WARN_FLAGS): Use tree_low_cst.
* c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c:
Regenerated.
* c-tree.h (min_precision): Move declaration to here.
* c-typeck.c (build_binary_op): Use host_integerp and tree_low_cst.
(build_unary_op, add_pending_init): Use bit_position.
(pending_init_member, process_init_element): Likewise.
(really_start_incremental_init, push_init_level, pop_init_level):
Don't make copies of nodes or modify them in place, use consistent
types when tracking positions, and use tree routines computations.
(set_init_index, output_init_element): Likewise.
(output_pending_init_elements, process_init_element): Likewise.
* dbxout.c (dbxout_type_fields): Use bit_position, host_integerp,
tree_low_cst and int_bit_position; also minor cleanup.
(dbxout_type_method_1, dbxout_range_type, dbxout_type): Likewise.
(print_cst_octal): Precision is unsigned.
(dbxout_symbol): Ensure DECL_INITIAL is in-range and use tree_low_cst.
* dwarf2out.c (ceiling): Input and output are unsigned HOST_WIDE_INT.
(simple_type_align_in_bits): Result is unsigned int.
Use tree_int_low_cst and host_integerp.
(simple_type_size_in_bits): Result is unsigned HOST_WIDE_INT.
(field_byte_offset): Result is HOST_WIDE_INT.
Change types of internal variables so alignments are unsigned int,
offsets are HOST_WIDE_INT and sizes are unsigned HOST_WIDE_INT.
Use host_integerp, tree_low_cst, and int_bit_position.
(add_bit_offset_attribute): Likewise.
(add_data_member_location_attribute): Use tree_cst_low.
(add_bound_info): Use host_integerp, integer_zerop, and integer_onep.
(add_bit_size_attribute): Use tree_low_cst.
(add_pure_or_virtual_attribute, gen_enumeration_type_die): Likewise.
* dwarfout.c: Similar changes to dwarf2out.c.
* expr.c (expand_expr, case ARRAY_REF): Remove redundant code.
* genoutput.c (n_occurences): Return -1 for null string.
(strip_whitespace): Accept null string and make into function.
(scan_operands): Reflect above changes.
* sdbout.c (plain_type_1): Use host_integerp and tree_low_cst.
(sdbout_field_types, sdbout_one_type): Likewise; also use bit_position.
* ssa.c (rename_registers): Add missing cast of arg to bzero.
* tree.c (int_size_in_bytes): Check for too big to represent.
(bit_position, int_bit_position, host_integerp, tree_low_cst): New fns.
* tree.h (host_integerp, tree_low_cst, bit_position, int_bit_position):
New declarations.
(min_precision): Delete from here.
* varasm.c (decode_addr_const): Use host_integerp, bit_position,
and int_bit_position.
* objc/objc-act.c (encode_method_prototype): Sizes are HOST_WIDE_INT.
(encode_method_def): Likewise.
(build_ivar_list_initializer): Use int_bit_position.
(generate_shared_structures): Convert size.
(encode_type, encode_complete_bitfield): Use integer_zerop.
(encode_bitfield): Use tree_low_cst and int_bit_position.
* ch/typeck.c (min_precision): New function.
(build_chill_slice): Use host_integerp and tree_low_cst.
(expand_constant_to_buffer): Likewise and also int_bit_position.
LO is unsigned HOST_WIDE_INT
(build_chill_array_ref_1): Make `i' be HOST_WIDE_INT; use tree_low_cst.
(extract_constant_from_buffer): Sizes are now HOST_WIDE_INT.
Use host_integerp and tree_low_cst.
(build_chill_bin_type): Use host_integerp and tree_low_cst.
(layout_chill_range_type): Use tree_int_cst_sgn, compare_tree_int,
tree_low_cst, and min_precision.
(apply_chill_array_layout): Cleanups for types of variables
and use tree_int_cst_sgn, compare_tree_int, and tree_low_cst.
(apply_chill_field_layout): Likewise.
* cp/class.c (build_vbase_path): Use integer_zerop.
(build_vtable_entry): Use tree_low_cst.
(get_vfield_offset): Use bit_position.
(dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT.
Use tree_low_cst.
(check_bitfield_decl): Set DECL_SIZE using convert.
(build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop.
(layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT.
Use tree_low_cst.
(finish_struct_1): Use bit_position.
(dump_class_hierarchy): Use tree_low_cst.
* cp/cp-tree.h (min_precision): Add declaration.
* cp/decl.c (xref_tag, xref_basetypes): Use tree_low_cst.
* cp/error.c (dump_type_suffix): Use host_integerp and tree_low_cst.
(dump_expr): Use integer_zerop, host_integerp, and tree_low_cst.
* cp/expr.c (cplus_expand_constant): Use bit_position.
* cp/init.c (build_vec_init): Use host_integerp and tree_low_cst.
* cp/rtti.c (get_base_offset): Use bit_position.
* cp/typeck.c (build_binary_op): Use integer_zerop, compare_tree_int,
host_integerp, and tree_low_cst.
(pointer_int_sum): Use integer_zerop.
(build_component_addr): Use bit_position.
* java/class.c (make_field_value): Properly handle sizes.
(get_dispatch_vector): Use tree_low_cst and host_integerp.
(layout_class_method): Count using trees.
* java/decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with
copy_node.
* java/expr.c (java_array_data_offset): Use int_bit_position.
(build_newarray, build_anewarray): Use host_integerp and tree_low_cst.
(build_invokevirtual): Use tree_low_cst and do computations with trees.
From-SVN: r32607
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 25 | ||||
-rw-r--r-- | gcc/cp/class.c | 37 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 1 | ||||
-rw-r--r-- | gcc/cp/decl.c | 4 | ||||
-rw-r--r-- | gcc/cp/error.c | 15 | ||||
-rw-r--r-- | gcc/cp/expr.c | 2 | ||||
-rw-r--r-- | gcc/cp/init.c | 4 | ||||
-rw-r--r-- | gcc/cp/rtti.c | 3 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 37 |
9 files changed, 71 insertions, 57 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index eaf70b6..45453b5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,28 @@ +Fri Mar 17 08:09:14 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * class.c (build_vbase_path): Use integer_zerop. + (build_vtable_entry): Use tree_low_cst. + (get_vfield_offset): Use bit_position. + (dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT. + Use tree_low_cst. + (check_bitfield_decl): Set DECL_SIZE using convert. + (build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop. + (layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT. + Use tree_low_cst. + (finish_struct_1): Use bit_position. + (dump_class_hierarchy): Use tree_low_cst. + * cp-tree.h (min_precision): Add declaration. + * decl.c (xref_tag, xref_basetypes): Use tree_low_cst. + * error.c (dump_type_suffix): Use host_integerp and tree_low_cst. + (dump_expr): Use integer_zerop, host_integerp, and tree_low_cst. + * expr.c (cplus_expand_constant): Use bit_position. + * init.c (build_vec_init): Use host_integerp and tree_low_cst. + * rtti.c (get_base_offset): Use bit_position. + * typeck.c (build_binary_op): Use integer_zerop, compare_tree_int, + host_integerp, and tree_low_cst. + (pointer_int_sum): Use integer_zerop. + (build_component_addr): Use bit_position. + 2000-03-17 Nathan Sidwell <nathan@codesourcery.com> * typeck.c (require_complete_type): Don't assume size_zero_node. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 9a66e1e..2540f27 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -635,7 +635,7 @@ build_vbase_path (code, type, expr, path, nonnull) else offset = BINFO_OFFSET (last); - if (TREE_INT_CST_LOW (offset)) + if (! integer_zerop (offset)) { /* Bash types to make the backend happy. */ offset = cp_convert (type, offset); @@ -691,8 +691,8 @@ build_vtable_entry (delta, vcall_index, entry) HOST_WIDE_INT idelta; HOST_WIDE_INT ivindex; - idelta = TREE_INT_CST_LOW (delta); - ivindex = TREE_INT_CST_LOW (vcall_index); + idelta = tree_low_cst (delta, 0); + ivindex = tree_low_cst (vcall_index, 0); if ((idelta || ivindex) && ! DECL_PURE_VIRTUAL_P (TREE_OPERAND (entry, 0))) { @@ -908,7 +908,7 @@ get_vfield_offset (binfo) { tree tmp = size_binop (FLOOR_DIV_EXPR, - DECL_FIELD_BITPOS (TYPE_VFIELD (BINFO_TYPE (binfo))), + bit_position (TYPE_VFIELD (BINFO_TYPE (binfo))), bitsize_int (BITS_PER_UNIT)); return size_binop (PLUS_EXPR, convert (sizetype, tmp), @@ -3111,7 +3111,8 @@ dfs_modify_vtables (binfo, data) tree overrider; tree vindex; tree delta; - unsigned HOST_WIDE_INT i; + HOST_WIDE_INT vindex_val, i; + /* Find the function which originally caused this vtable entry to be present. */ @@ -3121,7 +3122,8 @@ dfs_modify_vtables (binfo, data) fn = skip_rtti_stuff (TYPE_BINFO (BINFO_TYPE (b)), BINFO_TYPE (b), &i); - while (i < TREE_INT_CST_LOW (vindex)) + vindex_val = tree_low_cst (vindex, 0); + while (i < vindex_val) { fn = TREE_CHAIN (fn); ++i; @@ -3685,7 +3687,7 @@ check_bitfield_decl (field) if (DECL_INITIAL (field)) { DECL_INITIAL (field) = NULL_TREE; - DECL_SIZE (field) = bitsize_int (TREE_INT_CST_LOW (w)); + DECL_SIZE (field) = convert (bitsizetype, w); DECL_BIT_FIELD (field) = 1; if (integer_zerop (w)) @@ -4268,12 +4270,10 @@ build_base_field (rli, binfo, empty_p, base_align, v) here. */ *base_align = MAX (*base_align, DECL_ALIGN (decl)); DECL_SIZE (decl) - = size_int (MAX ((HOST_WIDE_INT) TREE_INT_CST_LOW (DECL_SIZE (decl)), - (int) (*base_align))); + = size_binop (MAX_EXPR, DECL_SIZE (decl), bitsize_int (*base_align)); DECL_SIZE_UNIT (decl) - = size_int (MAX (((HOST_WIDE_INT) TREE_INT_CST_LOW - (DECL_SIZE_UNIT (decl))), - (int) *base_align / BITS_PER_UNIT)); + = size_binop (MAX_EXPR, DECL_SIZE_UNIT (decl), + size_int (*base_align / BITS_PER_UNIT)); } if (!integer_zerop (DECL_SIZE (decl))) @@ -4768,10 +4768,11 @@ layout_virtual_bases (t) tree t; { tree vbase; - int dsize; + unsigned HOST_WIDE_INT dsize; /* DSIZE is the size of the class without the virtual bases. */ - dsize = TREE_INT_CST_LOW (TYPE_SIZE (t)); + dsize = tree_low_cst (TYPE_SIZE (t), 1); + /* Make every class have alignment of at least one. */ TYPE_ALIGN (t) = MAX (TYPE_ALIGN (t), BITS_PER_UNIT); @@ -4800,7 +4801,7 @@ layout_virtual_bases (t) /* Every virtual baseclass takes a least a UNIT, so that we can take it's address and get something different for each base. */ dsize += MAX (BITS_PER_UNIT, - TREE_INT_CST_LOW (CLASSTYPE_SIZE (basetype))); + tree_low_cst (CLASSTYPE_SIZE (basetype), 0)); } /* Make sure that all of the CLASSTYPE_VBASECLASSES have their @@ -5038,7 +5039,7 @@ layout_class_type (t, empty_p, has_virtual_p, For C++, we must handle the building of derived classes. Also, C++ allows static class members. The way that this is handled is to keep the field name where it is (as the DECL_NAME - of the field), and place the overloaded decl in the DECL_FIELD_BITPOS + of the field), and place the overloaded decl in the bit position of the field. layout_record and layout_union will know about this. More C++ hair: inline functions have text in their @@ -5124,7 +5125,7 @@ finish_struct_1 (t) DECL_FIELD_CONTEXT (vfield) = t; DECL_FIELD_BITPOS (vfield) - = size_binop (PLUS_EXPR, offset, DECL_FIELD_BITPOS (vfield)); + = size_binop (PLUS_EXPR, offset, bit_position (vfield)); TYPE_VFIELD (t) = vfield; } @@ -6538,7 +6539,7 @@ dump_class_hierarchy (binfo, indent) (unsigned long) binfo, type_as_string (binfo, TS_PLAIN)); fprintf (stderr, HOST_WIDE_INT_PRINT_DEC, - TREE_INT_CST_LOW (BINFO_OFFSET (binfo))); + tree_low_cst (BINFO_OFFSET (binfo), 0)); fprintf (stderr, " %s\n", BINFO_PRIMARY_MARKED_P (binfo) ? "primary" : ""); diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 88e6303..fd87926 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -3116,6 +3116,7 @@ extern tree convert_and_check PARAMS ((tree, tree)); extern void overflow_warning PARAMS ((tree)); extern void unsigned_conversion_warning PARAMS ((tree, tree)); extern void c_apply_type_quals_to_decl PARAMS ((int, tree)); +extern unsigned int min_precision PARAMS ((tree, int)); /* Read the rest of the current #-directive line. */ #if USE_CPPLIB diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index e815081..5a4a512 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -12350,7 +12350,7 @@ xref_tag (code_type_node, name, globalize) code_type_node = TREE_VALUE (code_type_node); } - tag_code = (enum tag_types) TREE_INT_CST_LOW (code_type_node); + tag_code = (enum tag_types) tree_low_cst (code_type_node, 1); switch (tag_code) { case record_type: @@ -12578,7 +12578,7 @@ xref_basetypes (code_type_node, name, ref, binfo) tree base; int i, len; - enum tag_types tag_code = (enum tag_types) TREE_INT_CST_LOW (code_type_node); + enum tag_types tag_code = (enum tag_types) tree_low_cst (code_type_node, 1); if (tag_code == union_type) { diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 0a26384..e5a0872 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -721,8 +721,8 @@ dump_type_suffix (t, flags) OB_PUTC ('['); if (TYPE_DOMAIN (t)) { - if (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (t))) == INTEGER_CST) - OB_PUTI (TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (t))) + 1); + if (host_integerp (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0)) + OB_PUTI (tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0) + 1); else if (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (t))) == MINUS_EXPR) dump_expr (TREE_OPERAND (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0), flags & ~TS_EXPR_PARENS); @@ -1477,9 +1477,7 @@ dump_expr (t, flags) } else if (type == boolean_type_node) { - if (t == boolean_false_node - || (TREE_INT_CST_LOW (t) == 0 - && TREE_INT_CST_HIGH (t) == 0)) + if (t == boolean_false_node || integer_zerop (t)) OB_PUTS ("false"); else if (t == boolean_true_node) OB_PUTS ("true"); @@ -1487,7 +1485,7 @@ dump_expr (t, flags) else if (type == char_type_node) { OB_PUTC ('\''); - dump_char (TREE_INT_CST_LOW (t)); + dump_char (tree_low_cst (t, 0)); OB_PUTC ('\''); } else if ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (t) @@ -1851,8 +1849,7 @@ dump_expr (t, flags) OB_PUTS (") 0)"); break; } - else if (TREE_CODE (idx) == INTEGER_CST - && TREE_INT_CST_HIGH (idx) == 0) + else if (host_integerp (idx, 0)) { tree virtuals; unsigned HOST_WIDE_INT n; @@ -1861,7 +1858,7 @@ dump_expr (t, flags) t = TYPE_METHOD_BASETYPE (t); virtuals = TYPE_BINFO_VIRTUALS (TYPE_MAIN_VARIANT (t)); - n = TREE_INT_CST_LOW (idx); + n = tree_low_cst (idx, 0); /* Map vtable index back one, to allow for the null pointer to member. */ diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c index 3fe6f99..e97a65d 100644 --- a/gcc/cp/expr.c +++ b/gcc/cp/expr.c @@ -62,7 +62,7 @@ cplus_expand_constant (cst) /* Find the offset for the field. */ offset = convert (sizetype, size_binop (EASY_DIV_EXPR, - DECL_FIELD_BITPOS (member), + bit_position (member), bitsize_int (BITS_PER_UNIT))); /* We offset all pointer to data members by 1 so that we diff --git a/gcc/cp/init.c b/gcc/cp/init.c index e448218..960f46b 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2872,9 +2872,9 @@ build_vec_init (decl, base, maxindex, init, from_array) if (from_array || (TYPE_NEEDS_CONSTRUCTING (type) - && ! (TREE_CODE (maxindex) == INTEGER_CST + && ! (host_integerp (maxindex, 0) && (num_initialized_elts - == (HOST_WIDE_INT) TREE_INT_CST_LOW (maxindex) + 1)))) + == tree_low_cst (maxindex, 0) + 1)))) { /* If the ITERATOR is equal to -1, then we don't have to loop; we've already initialized all the elements. */ diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 0c1986d..f06174c4 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -524,8 +524,7 @@ get_base_offset (binfo, parent) FORMAT_VBASE_NAME (name, t); field = lookup_field (parent, get_identifier (name), 0, 0); - offset = size_binop (FLOOR_DIV_EXPR, - DECL_FIELD_BITPOS (field), + offset = size_binop (FLOOR_DIV_EXPR, bit_position (field), bitsize_int (BITS_PER_UNIT)); offset = convert (sizetype, offset); } diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 6e74e3b..a92c1fe 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -3512,11 +3512,9 @@ build_binary_op (code, orig_op0, orig_op1) warning ("right shift count is negative"); else { - if (TREE_INT_CST_LOW (op1) | TREE_INT_CST_HIGH (op1)) + if (! integer_zerop (op1)) short_shift = 1; - if (TREE_INT_CST_HIGH (op1) != 0 - || ((unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (op1) - >= TYPE_PRECISION (type0))) + if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) warning ("right shift count >= width of type"); } } @@ -3537,9 +3535,7 @@ build_binary_op (code, orig_op0, orig_op1) { if (tree_int_cst_lt (op1, integer_zero_node)) warning ("left shift count is negative"); - else if (TREE_INT_CST_HIGH (op1) != 0 - || ((unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (op1) - >= TYPE_PRECISION (type0))) + else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) warning ("left shift count >= width of type"); } /* Convert the shift-count to an integer, regardless of @@ -3561,9 +3557,7 @@ build_binary_op (code, orig_op0, orig_op1) if (tree_int_cst_lt (op1, integer_zero_node)) warning ("%s rotate count is negative", (code == LROTATE_EXPR) ? "left" : "right"); - else if (TREE_INT_CST_HIGH (op1) != 0 - || ((unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (op1) - >= TYPE_PRECISION (type0))) + else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) warning ("%s rotate count >= width of type", (code == LROTATE_EXPR) ? "left" : "right"); } @@ -3894,8 +3888,7 @@ build_binary_op (code, orig_op0, orig_op1) if (TYPE_PRECISION (TREE_TYPE (arg0)) < TYPE_PRECISION (result_type) /* We can shorten only if the shift count is less than the number of bits in the smaller type size. */ - && TREE_INT_CST_HIGH (op1) == 0 - && TYPE_PRECISION (TREE_TYPE (arg0)) > TREE_INT_CST_LOW (op1) + && compare_tree_int (op1, TYPE_PRECISION (TREE_TYPE (arg0))) < 0 /* If arg is sign-extended and then unsigned-shifted, we can simulate this with a signed shift in arg's type only if the extended result is at least twice as wide @@ -4009,25 +4002,24 @@ build_binary_op (code, orig_op0, orig_op1) if (TREE_CODE (primop1) == BIT_NOT_EXPR) primop1 = get_narrower (TREE_OPERAND (op1, 0), &unsignedp1); - if (TREE_CODE (primop0) == INTEGER_CST - || TREE_CODE (primop1) == INTEGER_CST) + if (host_integerp (primop0, 0) || host_integerp (primop1, 0)) { tree primop; HOST_WIDE_INT constant, mask; int unsignedp; - unsigned bits; + unsigned int bits; - if (TREE_CODE (primop0) == INTEGER_CST) + if (host_integerp (primop0, 0)) { primop = primop1; unsignedp = unsignedp1; - constant = TREE_INT_CST_LOW (primop0); + constant = tree_low_cst (primop0, 0); } else { primop = primop0; unsignedp = unsignedp0; - constant = TREE_INT_CST_LOW (primop1); + constant = tree_low_cst (primop1, 0); } bits = TYPE_PRECISION (TREE_TYPE (primop)); @@ -4157,9 +4149,7 @@ pointer_int_sum (resultcode, ptrop, intop) /* Needed to make OOPS V2R3 work. */ intop = folded; - if (TREE_CODE (intop) == INTEGER_CST - && TREE_INT_CST_LOW (intop) == 0 - && TREE_INT_CST_HIGH (intop) == 0) + if (integer_zerop (intop)) return ptrop; /* If what we are about to multiply by the size of the elements @@ -4295,11 +4285,12 @@ build_component_addr (arg, argtype) /* This conversion is harmless. */ rval = convert_force (argtype, rval, 0); - if (! integer_zerop (DECL_FIELD_BITPOS (field))) + if (! integer_zerop (bit_position (field))) { - tree offset = size_binop (EASY_DIV_EXPR, DECL_FIELD_BITPOS (field), + tree offset = size_binop (EASY_DIV_EXPR, bit_position (field), bitsize_int (BITS_PER_UNIT)); int flag = TREE_CONSTANT (rval); + offset = convert (sizetype, offset); rval = fold (build (PLUS_EXPR, argtype, rval, cp_convert (argtype, offset))); |