From a59b038cc8edf2e34d5c9544a8805bf9b3450709 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 27 Mar 2012 10:35:55 +0000 Subject: expmed.c (store_bit_field): Assert that BITREGION_START is a multiple of a unit before computing the offset... * expmed.c (store_bit_field): Assert that BITREGION_START is a multiple of a unit before computing the offset in units. * expr.c (get_bit_range): Return the null range if the enclosing record is part of a larger bit field. From-SVN: r185857 --- gcc/expmed.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/expmed.c') diff --git a/gcc/expmed.c b/gcc/expmed.c index 5134b738..54e51dc 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -828,8 +828,7 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, /* Under the C++0x memory model, we must not touch bits outside the bit region. Adjust the address to start at the beginning of the bit region. */ - if (MEM_P (str_rtx) - && bitregion_start > 0) + if (MEM_P (str_rtx) && bitregion_start > 0) { enum machine_mode bestmode; enum machine_mode op_mode; @@ -839,6 +838,8 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, if (op_mode == MAX_MACHINE_MODE) op_mode = VOIDmode; + gcc_assert ((bitregion_start % BITS_PER_UNIT) == 0); + offset = bitregion_start / BITS_PER_UNIT; bitnum -= bitregion_start; bitregion_end -= bitregion_start; -- cgit v1.1