aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2001-08-31 22:54:19 +0000
committerRichard Henderson <rth@gcc.gnu.org>2001-08-31 15:54:19 -0700
commit57bfa49ae1ca6b049392285801bb1438e38a911a (patch)
tree880c6af2091fa66bdabd679d60dc406fd0219dec /gcc
parent4504a6554658e2b23a73856e99c50bc70ca6a324 (diff)
downloadgcc-57bfa49ae1ca6b049392285801bb1438e38a911a.zip
gcc-57bfa49ae1ca6b049392285801bb1438e38a911a.tar.gz
gcc-57bfa49ae1ca6b049392285801bb1438e38a911a.tar.bz2
expmed.c (store_bit_field): Update to patch from 2001-08-27: move adjustment of bitpos instead.
* expmed.c (store_bit_field): Update to patch from 2001-08-27: move adjustment of bitpos instead. From-SVN: r45338
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/expmed.c18
2 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 77be0dc..e03aa81 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-08-30 Roman Zippel <zippel@linux-m68k.org>
+
+ * expmed.c (store_bit_field): Update to patch from 2001-08-27:
+ move adjustment of bitpos instead.
+
2001-08-31 Zack Weinberg <zack@codesourcery.com>
* function.c: Remove all_functions. Make outer_function_chain
diff --git a/gcc/expmed.c b/gcc/expmed.c
index af5e56f..8bc66b2 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. */