[patch committed] SH: Fix build failure on mainline

Kaz Kojima kkojima@rr.iij4u.or.jp
Wed Mar 28 06:30:00 GMT 2007


The cross build for sh4-*-linux-gnu fails with:

build/gengtype ../../ORIG/trunk/gcc gtyp-input.list
../../ORIG/trunk/gcc/config/sh/sh.h:1987: unexpected character `&'
../../ORIG/trunk/gcc/config/sh/sh.h:1989: unexpected character `+'
../../ORIG/trunk/gcc/config/sh/sh.h:1989: unexpected character `?'
../../ORIG/trunk/gcc/config/sh/sh.h:1989: unexpected character `+'
../../ORIG/trunk/gcc/config/sh/sh.h:1993: unexpected character `&'
../../ORIG/trunk/gcc/config/sh/sh.h:1993: unexpected character `?'
make: *** [s-gtype] Error 1

It seems that the new gengtype doesn't like complex macro
definitions in the middle of a struct definition.  The patch
below moves them outside of a struct definition.

Regards,
	kaz
--
2007-03-28  Kaz Kojima  <kkojima@gcc.gnu.org>

	* config/sh/sh.h (CALL_COOKIE_RET_TRAMP_SHIFT): Move after
	the definition of struct sh_args.
	(CALL_COOKIE_RET_TRAMP, CALL_COOKIE_STACKSEQ_SHIFT,
	CALL_COOKIE_INT_REG_GET): Likewise.

diff -uprN ORIG/trunk/gcc/config/sh/sh.h LOCAL/trunk/gcc/config/sh/sh.h
--- ORIG/trunk/gcc/config/sh/sh.h	2007-03-28 12:31:59.000000000 +0900
+++ LOCAL/trunk/gcc/config/sh/sh.h	2007-03-28 12:33:33.000000000 +0900
@@ -1979,6 +1979,13 @@ struct sh_args {
 
      - If T is set, a return trampoline will be set up for 64-bit
      return values to be split into 2 32-bit registers.  */
+    long call_cookie;
+
+  /* This is set to nonzero when the call in question must use the Renesas ABI,
+     even without the -mrenesas option.  */
+    int renesas_abi;
+};
+
 #define CALL_COOKIE_RET_TRAMP_SHIFT 0
 #define CALL_COOKIE_RET_TRAMP(VAL) ((VAL) << CALL_COOKIE_RET_TRAMP_SHIFT)
 #define CALL_COOKIE_STACKSEQ_SHIFT 1
@@ -1991,12 +1998,6 @@ struct sh_args {
   ((VAL) << CALL_COOKIE_INT_REG_SHIFT (REG))
 #define CALL_COOKIE_INT_REG_GET(COOKIE, REG) \
   (((COOKIE) >> CALL_COOKIE_INT_REG_SHIFT (REG)) & ((REG) < 4 ? 7 : 15))
-    long call_cookie;
-
-  /* This is set to nonzero when the call in question must use the Renesas ABI,
-     even without the -mrenesas option.  */
-    int renesas_abi;
-};
 
 #define CUMULATIVE_ARGS  struct sh_args
 



More information about the Gcc-patches mailing list