aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-03-29 20:34:34 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2000-03-29 15:34:34 -0500
commitf2704b9f2aaddf08a546d689e49a1182a0908b9f (patch)
tree113b51730f955c5321c5845dfbce388eaf91bb66 /gcc/tree.c
parent2e3120e80da860959971db00816e1e5cfc2c93fb (diff)
downloadgcc-f2704b9f2aaddf08a546d689e49a1182a0908b9f.zip
gcc-f2704b9f2aaddf08a546d689e49a1182a0908b9f.tar.gz
gcc-f2704b9f2aaddf08a546d689e49a1182a0908b9f.tar.bz2
stor-layout.c (bit_from_pos, [...]): New functions.
* stor-layout.c (bit_from_pos, byte_from_pos): New functions. (pos_from_byte, pos_from_bit, normalize_offset): Likewise. (normalize_rli, rli_size_so_far, rli_size_unit_so_far): Use them. * tree.c (bit_position, byte_position): Likewise. * tree.h: Declare new functions. From-SVN: r32813
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 381d5f0..826327e 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2321,11 +2321,9 @@ tree
bit_position (field)
tree field;
{
- return size_binop (PLUS_EXPR, DECL_FIELD_BIT_OFFSET (field),
- size_binop (MULT_EXPR,
- convert (bitsizetype,
- DECL_FIELD_OFFSET (field)),
- bitsize_unit_node));
+
+ return bit_from_pos (DECL_FIELD_OFFSET (field),
+ DECL_FIELD_BIT_OFFSET (field));
}
/* Likewise, but return as an integer. Abort if it cannot be represented
@@ -2346,11 +2344,8 @@ tree
byte_position (field)
tree field;
{
- return size_binop (PLUS_EXPR, DECL_FIELD_OFFSET (field),
- convert (sizetype,
- size_binop (FLOOR_DIV_EXPR,
- DECL_FIELD_BIT_OFFSET (field),
- bitsize_unit_node)));
+ return byte_from_pos (DECL_FIELD_OFFSET (field),
+ DECL_FIELD_BIT_OFFSET (field));
}
/* Likewise, but return as an integer. Abort if it cannot be represented