Patch: Fix gcc.c-torture/compile/20000818-1.c on m68k.c
Roman Zippel
zippel@linux-m68k.org
Fri Aug 24 11:56:00 GMT 2001
Hi,
I've reported about this bug here:
http://gcc.gnu.org/ml/gcc/2001-08/msg00643.html
This patch fixes both problem cases mentioned. This bug only exists for
big endian targets, but only m68k aborts here. Other targets just generate
inefficient code (but possibly also wrong code).
Bootstrapped and regression tested on i686-linux and m68k-linux.
bye, Roman
2001-07-24 Roman Zippel <zippel@linux-m68k.org>
expmed.c (store_bit_field): ignore adjustment to bitpos and use
bitnum to decide about register move
Index: gcc/expmed.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/expmed.c,v
retrieving revision 1.87
diff -u -r1.87 expmed.c
--- expmed.c 2001/08/22 14:35:03 1.87
+++ expmed.c 2001/08/22 15:51:14
@@ -355,14 +355,13 @@
done with a simple store. For targets that support fast unaligned
memory, any naturally sized, unit aligned field can be done directly. */
- if (bitsize == GET_MODE_BITSIZE (fieldmode)
+ if (bitnum == 0 && bitsize == GET_MODE_BITSIZE (fieldmode)
&& (GET_CODE (op0) != MEM
? (GET_MODE_SIZE (fieldmode) >= UNITS_PER_WORD
|| GET_MODE_SIZE (GET_MODE (op0)) == GET_MODE_SIZE (fieldmode))
: (! SLOW_UNALIGNED_ACCESS (fieldmode, align)
|| (offset * BITS_PER_UNIT % bitsize == 0
- && align % GET_MODE_BITSIZE (fieldmode) == 0)))
- && (BYTES_BIG_ENDIAN ? bitpos + bitsize == unit : bitpos == 0))
+ && align % GET_MODE_BITSIZE (fieldmode) == 0))))
{
if (GET_MODE (op0) != fieldmode)
{
More information about the Gcc-patches
mailing list