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]

[PATCH] m32r-*-gcc 3.4 , 3.5 miss endian


Hi Nick,

This patch is to fix miss endian for m32r-*-gcc(3.4, 3.5).
Please commit it into 3.4-branch and mainline.

Regards,

Kaszuhiro Inaoka

gcc/ChangeLog

2004-04-16 Kazuhiro Inaoka <inaoka dot kazuhiro at renesas dot com>

	* config/m32r/m32r.h (BIG_ENDIAN_BIT): Deleted to fix endian
	bug.
	(TARGET_LITTLE_ENDIAN, TARGET_BIG_ENDIAN,
	TARGET_DEFAULT): Changed. Ditto.
	(LITTLE_ENDIAN_BIT, TARGET_CPU_DEFAULT,
	TERGET_ENDIAN_DEFAULT): Added. Ditto.
	* config/m32r/little.h (TARGET_LITTLE_ENDIAN): Deleted. Ditto.
	(TARGET_ENDIAN_DEFAULT): Added. Ditto.

Index: little.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32r/little.h,v
retrieving revision 1.1
diff -c -r1.1 little.h
*** little.h	31 Dec 2003 10:33:02 -0000	1.1
--- little.h	16 Apr 2004 06:21:17 -0000
***************
*** 19,25 ****
     Free Software Foundation, 59 Temple Place - Suite 330, Boston,
     MA 02111-1307, USA.  */
  
! #define TARGET_LITTLE_ENDIAN (!TARGET_BIG_ENDIAN)
  
  #define CPP_ENDIAN_SPEC \
    " %{mbe:-D__BIG_ENDIAN__} %{mbig-endian:-D__BIG_ENDIAN__}" \
--- 19,25 ----
     Free Software Foundation, 59 Temple Place - Suite 330, Boston,
     MA 02111-1307, USA.  */
  
! #define TARGET_ENDIAN_DEFAULT	LITTLE_ENDIAN_BIT
  
  #define CPP_ENDIAN_SPEC \
    " %{mbe:-D__BIG_ENDIAN__} %{mbig-endian:-D__BIG_ENDIAN__}" \
Index: m32r.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m32r/m32r.h,v
retrieving revision 1.99.4.2
diff -c -r1.99.4.2 m32r.h
*** m32r.h	9 Mar 2004 03:00:02 -0000	1.99.4.2
--- m32r.h	16 Apr 2004 06:21:17 -0000
***************
*** 247,260 ****
  #undef  TARGET_M32R
  #define TARGET_M32R             (! TARGET_M32RX && ! TARGET_M32R2)
  
- /* Big Endian Flag.  */
- #define BIG_ENDIAN_BIT 		(1 << 7)
- #define TARGET_BIG_ENDIAN       (target_flags & BIG_ENDIAN_BIT)
- 
  /* Little Endian Flag.  */
! #define LITTLE_ENDIAN_BIT 	(1 <<  8)
! #ifndef TARGET_LITTLE_ENDIAN 	/* See little.h */
! #define TARGET_LITTLE_ENDIAN    (target_flags & LITTLE_ENDIAN_BIT)
  #endif
  
  /* Macro to define tables used to set the flags.
--- 247,265 ----
  #undef  TARGET_M32R
  #define TARGET_M32R             (! TARGET_M32RX && ! TARGET_M32R2)
  
  /* Little Endian Flag.  */
! #define LITTLE_ENDIAN_BIT 	(1 << 7)
! #define TARGET_LITTLE_ENDIAN	(target_flags & LITTLE_ENDIAN_BIT)
! #define TARGET_BIG_ENDIAN       (!TARGET_LITTLE_ENDIAN)
! 
! /* This defaults us to big-endian.  */
! #ifndef TARGET_ENDIAN_DEFAULT
! #define TARGET_ENDIAN_DEFAULT 0
! #endif
! 
! /* This defaults us to m32r.  */
! #ifndef TARGET_CPU_DEFAULT
! #define TARGET_CPU_DEFAULT 0
  #endif
  
  /* Macro to define tables used to set the flags.
***************
*** 267,275 ****
  #define SUBTARGET_SWITCHES
  #endif
  
! #ifndef TARGET_DEFAULT
! #define TARGET_DEFAULT 0
! #endif
  
  #define TARGET_SWITCHES							\
  {									\
--- 272,278 ----
  #define SUBTARGET_SWITCHES
  #endif
  
! #define TARGET_DEFAULT (TARGET_CPU_DEFAULT|TARGET_ENDIAN_DEFAULT)
  
  #define TARGET_SWITCHES							\
  {									\

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