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]

Re: applied to sh port: change complex alignments (changes abi), and assorted other bug fixes


Joern Rennecke wrote:
> 2003-06-17  J"orn Rennecke <joern.rennecke@superh.com>
> 
>         * sh.h (ROUND_TYPE_ALIGN, LOCAL_ALIGNMENT): Complex modes
>         are aligned like integral modes.

After some further thought I've come to the conclusion that the bug
can be fixed just by aliging stack temporaries, thus not requiring
an ABI change.

Regression tested on sh-elf and sh64-elf.
		
-- 
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658
2003-06-20  J"orn Rennecke <joern.rennecke@superh.com>

	* sh.h (ROUND_TYPE_ALIGN): Remove.

Index: sh.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.h,v
retrieving revision 1.213
diff -p -r1.213 sh.h
*** sh.h	19 Jun 2003 21:47:23 -0000	1.213
--- sh.h	20 Jun 2003 19:11:32 -0000
*************** do {									\
*** 634,647 ****
  /* get_mode_alignment assumes complex values are always held in multiple
     registers, but that is not the case on the SH; CQImode and CHImode are
     held in a single integer register.  SH5 also holds CSImode and SCmode
!    values in integer regsters.  Thus the alignment needs to be bumped up
!    to match the size of the mode.  */
! #define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
!   (MAX ((GET_MODE_CLASS (TYPE_MODE (STRUCT)) == MODE_COMPLEX_INT \
! 	 || GET_MODE_CLASS (TYPE_MODE (STRUCT)) == MODE_COMPLEX_FLOAT) \
! 	? MIN (BIGGEST_ALIGNMENT, GET_MODE_BITSIZE (TYPE_MODE (STRUCT))) \
! 	: (COMPUTED), \
! 	(SPECIFIED)))
  #define LOCAL_ALIGNMENT(TYPE, ALIGN) \
    ((GET_MODE_CLASS (TYPE_MODE (TYPE)) == MODE_COMPLEX_INT \
      || GET_MODE_CLASS (TYPE_MODE (TYPE)) == MODE_COMPLEX_FLOAT) \
--- 634,641 ----
  /* get_mode_alignment assumes complex values are always held in multiple
     registers, but that is not the case on the SH; CQImode and CHImode are
     held in a single integer register.  SH5 also holds CSImode and SCmode
!    values in integer regsters.  This is relevant for argument passing on
!    SHcompact as we use a stack temp in order to pass CSImode by reference.  */
  #define LOCAL_ALIGNMENT(TYPE, ALIGN) \
    ((GET_MODE_CLASS (TYPE_MODE (TYPE)) == MODE_COMPLEX_INT \
      || GET_MODE_CLASS (TYPE_MODE (TYPE)) == MODE_COMPLEX_FLOAT) \

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