[PATCH] Misc d30v and xstormy16 cleanups.

Roger Sayle roger@eyesopen.com
Thu Jun 27 11:13:00 GMT 2002


Whilst reading through reg-stack.c trying to track down the source
of some superfluous "fxch" instructions, I thought I'd check the
target backends to confirm that i386 is the only target that
defines STACK_REGS.  Unfortunately, I stumbled across two false
positives, d30v and stormy16 which have #define STACK_REGS commented
out.  I thought I'd cleanup these configurations by removing these
unnecessary lines (like many similar config cleanups recently).

Despite these hunks being "obviously" correct, I still tried building
a cross-compiler to both d30v-unknown-elf and xstormy16-unknown-elf
from i686.  It appears that the xstormy16-* build is already broken
with the typedef of CUMULATIVE_ARGS on line 1322 of stormy16/stormy16.h
conflicting with the definition on line 1901 of gengtype.c.  A quick
check of the ChangeLog reveals the standard way to fix this problem
is to use a #define instead of a typedef.  With that change, stormy16's
front-ends build fine again, and the trivial comment removal patch
is confirmed not to introduce any compilation issues.

Tested with "make" to d30v-unknown-elf and xstormy16-unknown-elf, all
languages except Ada, where the compilations proceed until the expected
failure building crtbegin.o without a target toolchain.  I've no idea
how to test the compiler's themselves and testsuite results for these
targets have never been reported on the gcc-testsuite mailing list.

Ok for mainline?


2002-06-27  Roger Sayle  <roger@eyesopen.com>

	* config/d30v/d30v.h: Remove commented out STACK_REGS #defines.
	* config/stormy16/stormy16.h: Likewise.

	* config/stormy16/stormy16.h (CUMULATIVE_ARGS): Replace typedef
	with #define.


Index: config/d30v/d30v.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/d30v/d30v.h,v
retrieving revision 1.61
diff -c -3 -p -r1.61 d30v.h
*** config/d30v/d30v.h	19 Jun 2002 10:00:42 -0000	1.61
--- config/d30v/d30v.h	27 Jun 2002 15:03:57 -0000
*************** extern unsigned char modes_tieable_p[];
*** 611,630 ****
  /* #define LEAF_REG_REMAP(REGNO) */


- /* Registers That Form a Stack.  */
-
- /* Define this if the machine has any stack-like registers.  */
- /* #define STACK_REGS */
-
- /* The number of the first stack-like register.  This one is the top
-    of the stack.  */
- /* #define FIRST_STACK_REG */
-
- /* The number of the last stack-like register.  This one is the
-    bottom of the stack.  */
- /* #define LAST_STACK_REG */
-
-
  /* Register Classes */

  /* An enumeral type that must be defined with all the register class names as
--- 611,616 ----
Index: config/stormy16/stormy16.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/stormy16/stormy16.h,v
retrieving revision 1.49
diff -c -3 -p -r1.49 stormy16.h
*** config/stormy16/stormy16.h	12 Jun 2002 03:06:30 -0000	1.49
--- config/stormy16/stormy16.h	27 Jun 2002 15:04:04 -0000
*************** do {									\
*** 387,406 ****
  /* #define LEAF_REG_REMAP(REGNO) */


- /* Registers That Form a Stack.  */
-
- /* Define this if the machine has any stack-like registers.  */
- /* #define STACK_REGS */
-
- /* The number of the first stack-like register.  This one is the top
-    of the stack.  */
- /* #define FIRST_STACK_REG */
-
- /* The number of the last stack-like register.  This one is the
-    bottom of the stack.  */
- /* #define LAST_STACK_REG */
-
-
  /* Register Classes */

  /* An enumeral type that must be defined with all the register class names as
--- 387,392 ----
*************** enum reg_class
*** 1333,1339 ****

     For this platform, the value of CUMULATIVE_ARGS is the number of words
     of arguments that have been passed in registers so far.  */
! typedef int CUMULATIVE_ARGS;

  /* A C statement (sans semicolon) for initializing the variable CUM for the
     state at the beginning of the argument list.  The variable has type
--- 1319,1325 ----

     For this platform, the value of CUMULATIVE_ARGS is the number of words
     of arguments that have been passed in registers so far.  */
! #define CUMULATIVE_ARGS int

  /* A C statement (sans semicolon) for initializing the variable CUM for the
     state at the beginning of the argument list.  The variable has type


Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833



More information about the Gcc-patches mailing list