diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-08-31 22:54:19 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-08-31 22:54:19 +0000 |
commit | a29e3f426a8ff135a9ea43206eef6b8672b102f9 (patch) | |
tree | 880c6af2091fa66bdabd679d60dc406fd0219dec /gcc/expmed.c | |
parent | 46a70e7d0eee7274c581a4a11446e5d524e31807 (diff) | |
download | gcc-a29e3f426a8ff135a9ea43206eef6b8672b102f9.tar.gz |
* expmed.c (store_bit_field): Update to patch from 2001-08-27:
move adjustment of bitpos instead.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45338 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index af5e56fdd75..8bc66b27cd4 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -330,14 +330,6 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size) op0 = SUBREG_REG (op0); } - /* If OP0 is a register, BITPOS must count within a word. - But as we have it, it counts within whatever size OP0 now has. - On a bigendian machine, these are not the same, so convert. */ - if (BYTES_BIG_ENDIAN - && GET_CODE (op0) != MEM - && unit > GET_MODE_BITSIZE (GET_MODE (op0))) - bitpos += unit - GET_MODE_BITSIZE (GET_MODE (op0)); - value = protect_from_queue (value, 0); if (flag_force_mem) @@ -350,7 +342,7 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size) done with a simple store. For targets that support fast unaligned memory, any naturally sized, unit aligned field can be done directly. */ - if (bitnum == 0 + if (bitpos == 0 && bitsize == GET_MODE_BITSIZE (fieldmode) && (GET_CODE (op0) != MEM ? (GET_MODE_SIZE (fieldmode) >= UNITS_PER_WORD @@ -401,6 +393,14 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size) } } + /* If OP0 is a register, BITPOS must count within a word. + But as we have it, it counts within whatever size OP0 now has. + On a bigendian machine, these are not the same, so convert. */ + if (BYTES_BIG_ENDIAN + && GET_CODE (op0) != MEM + && unit > GET_MODE_BITSIZE (GET_MODE (op0))) + bitpos += unit - GET_MODE_BITSIZE (GET_MODE (op0)); + /* Storing an lsb-aligned field in a register can be done with a movestrict instruction. */ |