This is the mail archive of the 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, h8300]: Fix build on 64bit targets


gcc-4.2 currently fails to build for h8300 target on 64bit host with:

../../gcc-svn/trunk/gcc/libgcc2.c: In function '__muldi3':
../../gcc-svn/trunk/gcc/libgcc2.c:542: error: unrecognizable insn:
(insn 234 233 235 2 ../../gcc-svn/trunk/gcc/libgcc2.c:533 (set (reg:HI 3 r3)
(const_int 4294967214 [0xffffffae])) -1 (nil)
../../gcc-svn/trunk/gcc/libgcc2.c:542: internal compiler error: in extract_insn, at recog.c:2077

There is int / HWI mismatch in h8300.c Attached patch fixes the build.

BTW: There are still (harmless) warnings from as during the build:

/tmp/ccwynazV.s: Assembler messages:
/tmp/ccwynazV.s:20: Warning: operand #0xffffffffffffffe4 out of range.

But they are due to (old) 2.16.1 gas and should eventually be fixed in binutils.

2006-10-07 Uros Bizjak <>

       * config/h8300/h8300.c (h8300_emit_stack_adjustment): Change "size"
       argument to HOST_WIDE_INT.  Update function prototype.
       (round_frame_size): Change return type to HOST_WIDE_INT.  Change
       "size" argument to HOST_WIDE_INT.  Update function prototype.

Patch was checked by compiling gcc for h8300-elf target and visually checked produced ASM.


Index: h8300.c
--- h8300.c	(revision 117513)
+++ h8300.c	(working copy)
@@ -83,8 +83,8 @@
 static int h8300_saveall_function_p (tree);
 static int h8300_monitor_function_p (tree);
 static int h8300_os_task_function_p (tree);
-static void h8300_emit_stack_adjustment (int, unsigned int);
-static int round_frame_size (int);
+static void h8300_emit_stack_adjustment (int, HOST_WIDE_INT);
+static HOST_WIDE_INT round_frame_size (HOST_WIDE_INT);
 static unsigned int compute_saved_regs (void);
 static void push (int);
 static void pop (int);
@@ -510,7 +510,7 @@
    SIZE to adjust the stack pointer.  */
 static void
-h8300_emit_stack_adjustment (int sign, unsigned int size)
+h8300_emit_stack_adjustment (int sign, HOST_WIDE_INT size)
   /* If the frame size is 0, we don't have anything to do.  */
   if (size == 0)
@@ -546,8 +546,8 @@
 /* Round up frame size SIZE.  */
-static int
-round_frame_size (int size)
+round_frame_size (HOST_WIDE_INT size)
   return ((size + STACK_BOUNDARY / BITS_PER_UNIT - 1)

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