This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc/expmed.c 1.63->1.64
- To: Craig Newell <craign at ieee dot org>
- Subject: Re: gcc/expmed.c 1.63->1.64
- From: Richard Henderson <rth at cygnus dot com>
- Date: Mon, 25 Sep 2000 00:09:12 -0700
- Cc: gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, jakub at redhat dot com
- References: <Pine.LNX.4.21.0009242100040.12692-100000@localhost.localdomain>
On Sun, Sep 24, 2000 at 09:08:39PM -0400, Craig Newell wrote:
> 2000-09-15 Richard Henderson <rth@cygnus.com>
>
> * expmed.c (store_bit_field): Consider naturally aligned
> memory for direct reference.
[...]
> This will generate a word store at a non-aligned address no matter what
> options you give gcc.
Indeed. I've checked in your packed structure test case;
here is the fix.
r~
* expmed.c (store_bit_field): Adjust last change to not consider
any word-sized field naturally aligned.
Index: expmed.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/expmed.c,v
retrieving revision 1.64
diff -c -p -d -r1.64 expmed.c
*** expmed.c 2000/09/15 11:13:04 1.64
--- expmed.c 2000/09/25 07:05:31
*************** store_bit_field (str_rtx, bitsize, bitnu
*** 305,316 ****
memory, any naturally sized, unit aligned field can be done directly. */
if (bitsize == GET_MODE_BITSIZE (fieldmode)
! && (GET_MODE_SIZE (fieldmode) >= UNITS_PER_WORD
! || GET_MODE_SIZE (GET_MODE (op0)) == GET_MODE_SIZE (fieldmode)
! || (GET_CODE (op0) == MEM
! && (! 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))
{
if (GET_MODE (op0) != fieldmode)
--- 305,316 ----
memory, any naturally sized, unit aligned field can be done directly. */
if (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))
{
if (GET_MODE (op0) != fieldmode)