diff -cp -r gcc-3.2.1-orig/gcc/config/h8300/fixunssfsi.c gcc-3.2.1-work/gcc/config/h8300/fixunssfsi.c
*** gcc-3.2.1-orig/gcc/config/h8300/fixunssfsi.c	Mon May 19 00:50:44 2003
--- gcc-3.2.1-work/gcc/config/h8300/fixunssfsi.c	Sun May 18 18:25:43 2003
*************** Boston, MA 02111-1307, USA.  */
*** 33,38 ****
--- 33,41 ----
     the H8/300, that's in lib1funcs.asm, for H8/300H and H8/S, it's here.  */
  
  #ifndef __H8300__
+ 
+ extern long __fixunssfsi (float);
+ 
  long
  __fixunssfsi (float a)
  {
diff -cp -r gcc-3.2.1-orig/gcc/config/h8300/h8300.c gcc-3.2.1-work/gcc/config/h8300/h8300.c
*** gcc-3.2.1-orig/gcc/config/h8300/h8300.c	Mon May 19 00:50:44 2003
--- gcc-3.2.1-work/gcc/config/h8300/h8300.c	Sun May 18 18:41:43 2003
*************** print_operand (file, x, code)
*** 1198,1205 ****
  	    case SFmode:
  	      fprintf (file, "%s", names_extended[REGNO (x)]);
  	      break;
! 	    default:
! 	      abort ();
  	    }
  	  break;
  
--- 1198,1209 ----
  	    case SFmode:
  	      fprintf (file, "%s", names_extended[REGNO (x)]);
  	      break;
!             case DImode:
!             case DFmode:
! 	      fprintf (file, "%s", names_extended[REGNO (x)]);
! 	      break;
!             default:
!               abort ();
  	    }
  	  break;
  
diff -cp -r gcc-3.2.1-orig/gcc/config/h8300/h8300.h gcc-3.2.1-work/gcc/config/h8300/h8300.h
*** gcc-3.2.1-orig/gcc/config/h8300/h8300.h	Mon May 19 00:50:44 2003
--- gcc-3.2.1-work/gcc/config/h8300/h8300.h	Mon May 19 00:16:27 2003
*************** extern const char *h8_push_op, *h8_pop_o
*** 38,46 ****
  extern const char * const *h8_reg_names;
  
  /* Names to predefine in the preprocessor for this target machine.  */
! 
  #define CPP_PREDEFINES \
  "-D__LONG_MAX__=2147483647L -D__LONG_LONG_MAX__=2147483647L"
  
  #define CPP_SPEC \
    "%{!mh:%{!ms:-D__H8300__}} %{mh:-D__H8300H__} %{ms:-D__H8300S__} \
--- 38,49 ----
  extern const char * const *h8_reg_names;
  
  /* Names to predefine in the preprocessor for this target machine.  */
! /*
  #define CPP_PREDEFINES \
  "-D__LONG_MAX__=2147483647L -D__LONG_LONG_MAX__=2147483647L"
+ */
+ #define CPP_PREDEFINES \
+ "-D__LONG_MAX__=2147483647L"
  
  #define CPP_SPEC \
    "%{!mh:%{!ms:-D__H8300__}} %{mh:-D__H8300H__} %{ms:-D__H8300S__} \
*************** extern const char * const *h8_reg_names;
*** 51,56 ****
--- 54,60 ----
     %{mh:-Acpu=h8300h -Amachine=h8300h} \
     %{ms:-Acpu=h8300s -Amachine=h8300s} \
     %{!mint32:-D__INT_MAX__=32767} %{mint32:-D__INT_MAX__=2147483647} \
+    %{!mint32:-D__LONG_LONG_MAX__=2147483647L} %{mint32:-D__LONG_LONG_MAX__=9223372036854775807LL} \
     %(subtarget_cpp_spec)"
  
  #define SUBTARGET_CPP_SPEC ""
*************** extern int target_flags;
*** 217,231 ****
     See also the macro `Pmode' defined below.  */
  #define POINTER_SIZE (TARGET_H8300H || TARGET_H8300S ? 32 : 16)
  
! #define SHORT_TYPE_SIZE	16
  #define INT_TYPE_SIZE		(TARGET_INT32 ? 32 : 16)
  #define LONG_TYPE_SIZE		32
! #define LONG_LONG_TYPE_SIZE	32
! #define FLOAT_TYPE_SIZE	32
! #define DOUBLE_TYPE_SIZE	32
  #define LONG_DOUBLE_TYPE_SIZE	DOUBLE_TYPE_SIZE
  
! #define MAX_FIXED_MODE_SIZE	32
  
  /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
  #define PARM_BOUNDARY (TARGET_H8300H || TARGET_H8300S ? 32 : 16)
--- 221,235 ----
     See also the macro `Pmode' defined below.  */
  #define POINTER_SIZE (TARGET_H8300H || TARGET_H8300S ? 32 : 16)
  
! #define SHORT_TYPE_SIZE		16
  #define INT_TYPE_SIZE		(TARGET_INT32 ? 32 : 16)
  #define LONG_TYPE_SIZE		32
! #define LONG_LONG_TYPE_SIZE	(TARGET_INT32 ? 64 : 32)
! #define FLOAT_TYPE_SIZE		32
! #define DOUBLE_TYPE_SIZE	(TARGET_INT32 ? 64 : 32)
  #define LONG_DOUBLE_TYPE_SIZE	DOUBLE_TYPE_SIZE
  
! #define MAX_FIXED_MODE_SIZE	(TARGET_INT32 ? 64 : 32)
  
  /* Allocation boundary (in *bits*) for storing arguments in argument list.  */
  #define PARM_BOUNDARY (TARGET_H8300H || TARGET_H8300S ? 32 : 16)
*************** enum reg_class {
*** 623,630 ****
  
  /* Return true if X should be returned in memory.  */
  #define RETURN_IN_MEMORY(X) \
!   (TYPE_MODE (X) == BLKmode || GET_MODE_SIZE (TYPE_MODE (X)) > 4)
! 
  /* When defined, the compiler allows registers explicitly used in the
     rtl to be used as spill registers but prevents the compiler from
     extending the lifetime of these registers.  */
--- 627,633 ----
  
  /* Return true if X should be returned in memory.  */
  #define RETURN_IN_MEMORY(X) \
!   (TYPE_MODE (X) == BLKmode || GET_MODE_SIZE (TYPE_MODE (X)) > MAX_FIXED_MODE_SIZE)
  /* When defined, the compiler allows registers explicitly used in the
     rtl to be used as spill registers but prevents the compiler from
     extending the lifetime of these registers.  */
*************** readonly_data ()							\
*** 1337,1340 ****
--- 1340,1370 ----
  
  #define MOVE_RATIO 3
  
+ 
+ /* Define this if most significant word of doubles is the lowest numbered.
+    This is always true, even when in little-endian mode.  */
+ #define FLOAT_WORDS_BIG_ENDIAN 1
+ #define LIBGCC2_
+ 
+ /* If compling libgcc2.c make size macros compile time constants.  */
+ #ifdef IN_LIBGCC2
+ 
+ #undef LONG_LONG_TYPE_SIZE
+ #undef DOUBLE_TYPE_SIZE
+ #undef LONG_DOUBLE_TYPE_SIZE
+ 
+ #if __INT_MAX__ == 32767
+ #define DI SI
+ #define DF SF
+ #define LONG_LONG_TYPE_SIZE 32
+ #define DOUBLE_TYPE_SIZE 32
+ #define FLOAT_ONLY
+ #else
+ #define LONG_LONG_TYPE_SIZE 64
+ #define DOUBLE_TYPE_SIZE 64
+ #endif
+ 
+ #define LONG_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE
+ #endif
+ 
  #endif /* ! GCC_H8300_H */
diff -cp -r gcc-3.2.1-orig/gcc/config/h8300/t-h8300 gcc-3.2.1-work/gcc/config/h8300/t-h8300
*** gcc-3.2.1-orig/gcc/config/h8300/t-h8300	Mon May 19 00:50:44 2003
--- gcc-3.2.1-work/gcc/config/h8300/t-h8300	Sun May 18 18:25:43 2003
***************
*** 1,22 ****
- # The three first floating point functions listed in LIB1ASMFUNCS (_fixsfdi,
- # _floatdisf, and _fixunssfdi) are used to disable the inclusion of those
- # from libgcc2.c.  They do not actually exist in lib1funcs.asm.
  LIB1ASMSRC = h8300/lib1funcs.asm
! LIB1ASMFUNCS = _cmpsi2 _ucmpsi2 _divhi3 _divsi3 _mulhi3 _mulsi3 \
!   _floatdisf _fixsfdi _fixunssfdi _fixunssfsi_asm
  
  LIB2FUNCS_EXTRA = $(srcdir)/config/h8300/fixunssfsi.c
  
- # We do not have DF or DI types, so fake out the libgcc2 compilation.
- TARGET_LIBGCC2_CFLAGS = -DDF=SF -DDI=SI
- 
  # We want fine grained libraries, so use the new code to build the
  # floating point emulation libraries.
  FPBIT = fp-bit.c
  
  fp-bit.c: $(srcdir)/config/fp-bit.c
! 	echo '#define FLOAT' > fp-bit.c
! 	echo '#define FLOAT_ONLY' >> fp-bit.c
  	echo '#define SMALL_MACHINE' >> fp-bit.c
  	echo '#ifdef __H8300__' >> fp-bit.c
  	echo '#define CMPtype HItype' >> fp-bit.c
--- 1,15 ----
  LIB1ASMSRC = h8300/lib1funcs.asm
! LIB1ASMFUNCS = _cmpsi2 _ucmpsi2 _divhi3 _divsi3 _mulhi3 _mulsi3  _fixunssfsi_asm
  
  LIB2FUNCS_EXTRA = $(srcdir)/config/h8300/fixunssfsi.c
  
  # We want fine grained libraries, so use the new code to build the
  # floating point emulation libraries.
  FPBIT = fp-bit.c
+ DPBIT = dp-bit.c
  
  fp-bit.c: $(srcdir)/config/fp-bit.c
! 	echo '#define FLOAT' >> fp-bit.c
  	echo '#define SMALL_MACHINE' >> fp-bit.c
  	echo '#ifdef __H8300__' >> fp-bit.c
  	echo '#define CMPtype HItype' >> fp-bit.c
*************** fp-bit.c: $(srcdir)/config/fp-bit.c
*** 25,30 ****
--- 18,32 ----
  	echo '#endif' >> fp-bit.c
  	cat $(srcdir)/config/fp-bit.c >> fp-bit.c
  
+ dp-bit.c: $(srcdir)/config/fp-bit.c
+ 	echo '#define SMALL_MACHINE' >> dp-bit.c
+ 	echo '#ifdef __H8300__' >> dp-bit.c
+ 	echo '#define CMPtype HItype' >> dp-bit.c
+ 	echo '#else' >> dp-bit.c
+ 	echo '#define CMPtype SItype' >> dp-bit.c
+ 	echo '#endif' >> dp-bit.c
+ 	cat $(srcdir)/config/fp-bit.c >> dp-bit.c
+ 
  MULTILIB_OPTIONS = mh/ms mint32
  MULTILIB_DIRNAMES = h8300h h8300s int32
  MULTILIB_EXCEPTIONS = mint32
diff -cp -r gcc-3.2.1-orig/gcc/config.gcc gcc-3.2.1-work/gcc/config.gcc
*** gcc-3.2.1-orig/gcc/config.gcc	Wed Oct 23 18:28:29 2002
--- gcc-3.2.1-work/gcc/config.gcc	Mon May 19 00:57:30 2003
*************** h8300-*-rtems*)
*** 859,865 ****
  h8300-*-elf*)
  	tmake_file="h8300/t-h8300 h8300/t-elf"
  	tm_file="h8300/h8300.h h8300/elf.h"
! 	float_format=i32
  	;;
  h8300-*-*)
  	float_format=i32
--- 859,865 ----
  h8300-*-elf*)
  	tmake_file="h8300/t-h8300 h8300/t-elf"
  	tm_file="h8300/h8300.h h8300/elf.h"
! 	float_format=i64
  	;;
  h8300-*-*)
  	float_format=i32
diff -cp -r gcc-3.2.1-orig/gcc/optabs.c gcc-3.2.1-work/gcc/optabs.c
*** gcc-3.2.1-orig/gcc/optabs.c	Mon May 19 00:50:44 2003
--- gcc-3.2.1-work/gcc/optabs.c	Sun May 18 18:31:26 2003
*************** expand_binop (mode, binoptab, op0, op1, 
*** 1284,1289 ****
--- 1284,1291 ----
  						   copy_rtx (xop0),
  						   copy_rtx (xop1)));
  	    }
+           else
+             target = xtarget;
  
  	  return target;
  	}

