This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Fwd: Re: Patch to fix unaligned access in float->union assignment]


That should have been a group reply... time to go home now.

-------- Original Message --------
Message-ID: <3DE7CB09.FF0BFD6A@superh.com>
Date: Fri, 29 Nov 2002 20:16:09 +0000
From: Joern Rennecke <joern.rennecke@superh.com>
Organization: SuperH UK Ltd.
X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.9-21smp i686)
X-Accept-Language: en
MIME-Version: 1.0
To: Richard Henderson <rth@redhat.com>
Subject: Re: Patch to fix unaligned access in float->union assignment
References: <3DE63279.62513FEF@superh.com> <20021129194734.GB602@redhat.com>
Content-Type: multipart/mixed;boundary="------------E31D8AB646B5C4EF4E2D39FA"

Richard Henderson wrote:
> 
> On Thu, Nov 28, 2002 at 03:12:57PM +0000, Joern Rennecke wrote:
> >       * expmed.c (store_bit_field): Use int_mode_for_mode to find
> >       corresponding mode of non-integer mode.
> 
> Ok with parenthesis fixed.

Hmm, just after I've checked it in an sh-elf test build hit a problem
with a CONST_INT...
I've checked in the attached amendment as obvious - it is reverting to
the old behaviour for CONST_INTs.
	
-- 
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 1.15234.2.124
diff -p -r1.15234.2.124 ChangeLog
*** ChangeLog	29 Nov 2002 19:58:42 -0000	1.15234.2.124
--- ChangeLog	29 Nov 2002 20:11:29 -0000
***************
*** 1,7 ****
! Fri Nov 29 19:57:10 2002  J"orn Rennecke <joern.rennecke@superh.com>
  
  	* expmed.c (store_bit_field): Use int_mode_for_mode to find
! 	corresponding mode of non-integer mode.
  
  Thu Nov 28 23:56:24 CET 2002  Jan Hubicka  <jh@suse.cz>
  
--- 1,7 ----
! Fri Nov 29 20:10:56 2002  J"orn Rennecke <joern.rennecke@superh.com>
  
  	* expmed.c (store_bit_field): Use int_mode_for_mode to find
! 	corresponding mode of non-integer mode, unless it is VOIDmode.
  
  Thu Nov 28 23:56:24 CET 2002  Jan Hubicka  <jh@suse.cz>
  
Index: expmed.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expmed.c,v
retrieving revision 1.122.4.3
diff -p -r1.122.4.3 expmed.c
*** expmed.c	29 Nov 2002 19:58:49 -0000	1.122.4.3
--- expmed.c	29 Nov 2002 20:11:29 -0000
*************** store_bit_field (str_rtx, bitsize, bitnu
*** 535,541 ****
       structure fields.  */
    if (GET_MODE_CLASS (GET_MODE (value)) != MODE_INT
        && GET_MODE_CLASS (GET_MODE (value)) != MODE_PARTIAL_INT)
!     value = gen_lowpart (int_mode_for_mode (GET_MODE (value)), value);
  
    /* Now OFFSET is nonzero only if OP0 is memory
       and is therefore always measured in bytes.  */
--- 535,543 ----
       structure fields.  */
    if (GET_MODE_CLASS (GET_MODE (value)) != MODE_INT
        && GET_MODE_CLASS (GET_MODE (value)) != MODE_PARTIAL_INT)
!     value = gen_lowpart ((GET_MODE (value) == VOIDmode
! 			  ? word_mode : int_mode_for_mode (GET_MODE (value))),
! 			 value);
  
    /* Now OFFSET is nonzero only if OP0 is memory
       and is therefore always measured in bytes.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]