(store_fixed_bit_field): Adjust BITPOS so that it
fits inside MODE before adjusting OFFSET to get an aligned address. From-SVN: r6658
This commit is contained in:
parent
a5f00f07f1
commit
3bd98790b0
10
gcc/expmed.c
10
gcc/expmed.c
@ -569,6 +569,16 @@ store_fixed_bit_field (op0, offset, bitsize, bitpos, value, struct_align)
|
||||
|
||||
total_bits = GET_MODE_BITSIZE (mode);
|
||||
|
||||
/* Make sure bitpos is valid for the chosen mode. Adjust BITPOS to
|
||||
be be in the range 0 to total_bits-1, and put any excess bytes in
|
||||
OFFSET. */
|
||||
if (bitpos >= total_bits)
|
||||
{
|
||||
offset += (bitpos / total_bits) * (total_bits / BITS_PER_UNIT);
|
||||
bitpos -= ((bitpos / total_bits) * (total_bits / BITS_PER_UNIT)
|
||||
* BITS_PER_UNIT);
|
||||
}
|
||||
|
||||
/* Get ref to an aligned byte, halfword, or word containing the field.
|
||||
Adjust BITPOS to be position within a word,
|
||||
and OFFSET to be the offset of that word.
|
||||
|
Loading…
Reference in New Issue
Block a user