diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2000-04-25 12:15:25 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2000-04-25 08:15:25 -0400 |
commit | 65e14bf592104223ad62014869b6a6795173cd8d (patch) | |
tree | 7dc227f9b6803825d296a44dddf6d3f5321d5c66 | |
parent | 05183359dab76cc72b7c149b44b79012e8234b88 (diff) | |
download | gcc-65e14bf592104223ad62014869b6a6795173cd8d.zip gcc-65e14bf592104223ad62014869b6a6795173cd8d.tar.gz gcc-65e14bf592104223ad62014869b6a6795173cd8d.tar.bz2 |
stor-layout.c (finalize_record_size): Simplify to use existing functions.
* stor-layout.c (finalize_record_size): Simplify to use existing
functions.
(compute_record_mode): No longer static.
* tree.h (compute_record_mode): New declaration.
From-SVN: r33412
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/stor-layout.c | 32 | ||||
-rw-r--r-- | gcc/tree.h | 1 |
3 files changed, 21 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a09d530..3022208 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +Tue Apr 25 07:33:12 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * stor-layout.c (finalize_record_size): Simplify to use existing + functions. + (compute_record_mode): No longer static. + * tree.h (compute_record_mode): New declaration. + 2000-04-25 Neil Booth <NeilB@earthling.net> * Revert my patch below until cause of build failures @@ -8,8 +15,6 @@ * combine.c (combine_instructions): Add missing argument to try_combine. -2000-04-25 Richard Henderson <rth@cygnus.com> - * toplev.c (rest_of_compilation): Delay sibcall optimization until after emit_eh_context. diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index cce030b..3336cc8 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -51,7 +51,6 @@ unsigned int maximum_field_alignment; unsigned int set_alignment = 0; static void finalize_record_size PARAMS ((record_layout_info)); -static void compute_record_mode PARAMS ((tree)); static void finalize_type_size PARAMS ((tree)); static void place_union_field PARAMS ((record_layout_info, tree)); @@ -890,13 +889,10 @@ finalize_record_size (rli) { tree unpadded_size, unpadded_size_unit; - /* Next move any full bytes of bits into the byte size. */ - rli->offset - = size_binop (PLUS_EXPR, rli->offset, - convert (sizetype, - size_binop (TRUNC_DIV_EXPR, rli->bitpos, - bitsize_unit_node))); - rli->bitpos = size_binop (TRUNC_MOD_EXPR, rli->bitpos, bitsize_unit_node); + /* Now we want just byte and bit offsets, so set the offset alignment + to be a byte and then normalize. */ + rli->offset_align = BITS_PER_UNIT; + normalize_rli (rli); /* Determine the desired alignment. */ #ifdef ROUND_TYPE_ALIGN @@ -906,16 +902,14 @@ finalize_record_size (rli) TYPE_ALIGN (rli->t) = MAX (TYPE_ALIGN (rli->t), rli->record_align); #endif - unpadded_size - = size_binop (PLUS_EXPR, rli->bitpos, - size_binop (MULT_EXPR, convert (bitsizetype, rli->offset), - bitsize_unit_node)); - - unpadded_size_unit - = size_binop (PLUS_EXPR, rli->offset, - convert (sizetype, - size_binop (CEIL_DIV_EXPR, rli->bitpos, - bitsize_unit_node))); + /* Compute the size so far. Be sure to allow for extra bits in the + size in bytes. We have guaranteed above that it will be no more + than a single byte. */ + unpadded_size = rli_size_so_far (rli); + unpadded_size_unit = rli_size_unit_so_far (rli); + if (! integer_zerop (rli->bitpos)) + unpadded_size_unit + = size_binop (PLUS_EXPR, unpadded_size_unit, size_one_node); /* Record the un-rounded size in the binfo node. But first we check the size of TYPE_BINFO to make sure that BINFO_SIZE is available. */ @@ -993,7 +987,7 @@ finalize_record_size (rli) /* Compute the TYPE_MODE for the TYPE (which is a RECORD_TYPE). */ -static void +void compute_record_mode (type) tree type; { @@ -1800,6 +1800,7 @@ extern tree rli_size_unit_so_far PARAMS ((record_layout_info)); extern tree rli_size_so_far PARAMS ((record_layout_info)); extern void normalize_rli PARAMS ((record_layout_info)); extern void place_field PARAMS ((record_layout_info, tree)); +extern void compute_record_mode PARAMS ((tree)); extern void finish_record_layout PARAMS ((record_layout_info)); /* Given a hashcode and a ..._TYPE node (for which the hashcode was made), |