+2012-03-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ * expmed.c (store_bit_field): Assert that BITREGION_START is a multiple
+ of a unit before computing the offset in units.
+
2012-03-27 Richard Guenther <rguenther@suse.de>
PR middle-end/52720
/* 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;
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;