aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-03-27 10:35:55 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-03-27 10:35:55 +0000
commita59b038cc8edf2e34d5c9544a8805bf9b3450709 (patch)
treeafcd36162228e58e77087033fa077738a70aad88 /gcc/expmed.c
parentd102ab714fbf00fbbf8b0c2e022a315b85c5e22a (diff)
downloadgcc-a59b038cc8edf2e34d5c9544a8805bf9b3450709.zip
gcc-a59b038cc8edf2e34d5c9544a8805bf9b3450709.tar.gz
gcc-a59b038cc8edf2e34d5c9544a8805bf9b3450709.tar.bz2
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
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c5
1 files changed, 3 insertions, 2 deletions
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;