Patch: Add clipper-protos.h file

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Wed Jan 12 16:39:00 GMT 2000


Tested by building cc1 configured as an i686-pc-linux-gnu ->
clipper-intergraph-clix cross compiler.

Note to the reviewer:

clipper.c made reference to build_int a few times, which doesn't exist
and cc1 wouldn't link.  I changed it to build_int_2, please double
check this is correct.

Okay to install?

		--Kaveh



2000-01-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* clipper-protos.h: New file.

	* clipper.c: Include tm_p.h.  Add static prototypes.  Fix compile
	time warnings.
	
	* clipper.h: Move prototypes to clipper-protos.h.  Fix compile time
	warnings.
	
diff -rup orig/egcs-CVS20000112/gcc/config/clipper/clipper-protos.h egcs-CVS20000112/gcc/config/clipper/clipper-protos.h
--- orig/egcs-CVS20000112/gcc/config/clipper/clipper-protos.h	Wed Jan 12 09:43:24 2000
+++ egcs-CVS20000112/gcc/config/clipper/clipper-protos.h	Wed Jan 12 12:33:42 2000
@@ -0,0 +1,40 @@
+/* Definitions of target machine for GNU compiler.  Clipper version.
+   Copyright (C) 2000 Free Software Foundation, Inc.
+   Contributed by Holger Teutsch (holger@hotbso.rhein-main.de)
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#ifdef RTX_CODE
+#ifdef TREE_CODE
+extern void clipper_va_start PARAMS ((int, tree, rtx));
+extern rtx clipper_va_arg PARAMS ((tree, tree));
+#endif /* TREE_CODE */
+extern void clipper_movstr PARAMS ((rtx *));
+extern void print_operand_address PARAMS ((FILE *, rtx));
+extern const char *rev_cond_name PARAMS ((rtx));
+extern int int_reg_operand PARAMS ((rtx, enum machine_mode));
+extern int fp_reg_operand PARAMS ((rtx, enum machine_mode));
+#endif /* RTX_CODE */
+
+extern struct rtx_def *clipper_builtin_saveregs PARAMS ((void));
+extern int clipper_frame_size PARAMS ((int));
+extern void output_function_prologue PARAMS ((FILE *, int));
+extern void output_function_epilogue PARAMS ((FILE *, int));
+#ifdef TREE_CODE
+extern tree clipper_build_va_list PARAMS ((void));
+#endif /* TREE_CODE */
diff -rup orig/egcs-CVS20000112/gcc/config/clipper/clipper.c egcs-CVS20000112/gcc/config/clipper/clipper.c
--- orig/egcs-CVS20000112/gcc/config/clipper/clipper.c	Tue Sep  7 01:48:23 1999
+++ egcs-CVS20000112/gcc/config/clipper/clipper.c	Wed Jan 12 12:33:40 2000
@@ -35,7 +35,8 @@ Boston, MA 02111-1307, USA.  */
 #include "function.h"
 #include "expr.h"
 #include "flags.h"
-#include "machmode.h"
+#include "recog.h"
+#include "tm_p.h"
 
 extern char regs_ever_live[];
 
@@ -134,7 +135,7 @@ output_function_prologue (file, lsize)
 void
 output_function_epilogue (file, size)
      FILE *file;
-     int size;				/* ignored */
+     int size ATTRIBUTE_UNUSED;
 {
   int i, offset;
 
@@ -282,13 +283,13 @@ clipper_movstr (operands)
 }
 
 
+void
 print_operand_address (file, addr)
      FILE *file;
      register rtx addr;
 {
   rtx op0,op1;
 
- retry:
   switch (GET_CODE (addr))
     {
     case REG:
@@ -329,7 +330,7 @@ print_operand_address (file, addr)
 }
 
 
-char *
+const char *
 rev_cond_name (op)
      rtx op;
 {
@@ -507,7 +508,7 @@ clipper_va_start (stdarg_p, valist, next
   /* Set the four entries of __va_reg.  */
 
   t = build1 (NOP_EXPR, ptr_type_node, save_area);
-  u = build (ARRAY_REF, ptr_type_node, reg_field, build_int (0, 0));
+  u = build (ARRAY_REF, ptr_type_node, reg_field, build_int_2 (0, 0));
   t = build (MODIFY_EXPR, ptr_type_node, u, t);
   TREE_SIDE_EFFECTS (t) = 1;
   expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -515,7 +516,7 @@ clipper_va_start (stdarg_p, valist, next
   t = fold (build (PLUS_EXPR, integer_type_node, save_area,
 		   build_int_2 (8, 0)));
   t = build1 (NOP_EXPR, ptr_type_node, save_area);
-  u = build (ARRAY_REF, ptr_type_node, reg_field, build_int (1, 0));
+  u = build (ARRAY_REF, ptr_type_node, reg_field, build_int_2 (1, 0));
   t = build (MODIFY_EXPR, ptr_type_node, u, t);
   TREE_SIDE_EFFECTS (t) = 1;
   expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -523,7 +524,7 @@ clipper_va_start (stdarg_p, valist, next
   t = fold (build (PLUS_EXPR, integer_type_node, save_area,
 		   build_int_2 (4, 0)));
   t = build1 (NOP_EXPR, ptr_type_node, save_area);
-  u = build (ARRAY_REF, ptr_type_node, reg_field, build_int (2, 0));
+  u = build (ARRAY_REF, ptr_type_node, reg_field, build_int_2 (2, 0));
   t = build (MODIFY_EXPR, ptr_type_node, u, t);
   TREE_SIDE_EFFECTS (t) = 1;
   expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -531,7 +532,7 @@ clipper_va_start (stdarg_p, valist, next
   t = fold (build (PLUS_EXPR, integer_type_node, save_area,
 		   build_int_2 (16, 0)));
   t = build1 (NOP_EXPR, ptr_type_node, save_area);
-  u = build (ARRAY_REF, ptr_type_node, reg_field, build_int (3, 0));
+  u = build (ARRAY_REF, ptr_type_node, reg_field, build_int_2 (3, 0));
   t = build (MODIFY_EXPR, ptr_type_node, u, t);
   TREE_SIDE_EFFECTS (t) = 1;
   expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
diff -rup orig/egcs-CVS20000112/gcc/config/clipper/clipper.h egcs-CVS20000112/gcc/config/clipper/clipper.h
--- orig/egcs-CVS20000112/gcc/config/clipper/clipper.h	Tue Sep  7 01:48:24 1999
+++ egcs-CVS20000112/gcc/config/clipper/clipper.h	Wed Jan 12 12:52:36 2000
@@ -1,5 +1,5 @@
 /* Definitions of target machine for GNU compiler.  Clipper version.
-   Copyright (C) 1987, 88, 91, 93-96, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1987, 88, 91, 93-96, 98, 99, 2000 Free Software Foundation, Inc.
    Contributed by Holger Teutsch (holger@hotbso.rhein-main.de)
 
 This file is part of GNU CC.
@@ -19,9 +19,6 @@ along with GNU CC; see the file COPYING.
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-extern struct rtx_def *clipper_builtin_saveregs ();
-extern int clipper_frame_size ();
-
 /* Print subsidiary information on the compiler version in use.  */
 
 #define TARGET_VERSION fprintf (stderr, " (clipper)");
@@ -209,7 +206,7 @@ extern int target_flags;
 
 #define HARD_REGNO_MODE_OK(REGNO, MODE)					\
   ((REGNO) < 16 							\
-   ? ((MODE) != DImode && (MODE) != DFmode || ((REGNO) & 1) == 0)	\
+   ? (((MODE) != DImode && (MODE) != DFmode) || ((REGNO) & 1) == 0)	\
    : ((MODE) == SFmode || (MODE) == DFmode))
 
 /* Value is 1 if it is a good idea to tie two pseudo registers
@@ -282,7 +279,7 @@ enum reg_class { NO_REGS, GENERAL_REGS, 
    This is an initializer for a vector of HARD_REG_SET
    of length N_REG_CLASSES.  */
 
-#define REG_CLASS_CONTENTS {0, 0x0000ffff, 0xffff0000, 0xffffffff}
+#define REG_CLASS_CONTENTS { {0}, {0x0000ffff}, {0xffff0000}, {0xffffffff} }
 
 /* The same information, inverted:
    Return the class number of the smallest class containing
@@ -921,8 +918,8 @@ do									      \
     {									      \
     case CC_CHANGE0:							      \
       if (GET_CODE (EXP) == PARALLEL) abort();				      \
-      if (cc_status.value1 && rtx_equal_p (dest, cc_status.value1) ||	      \
-	  cc_status.value2 && rtx_equal_p (dest, cc_status.value2))	      \
+      if ((cc_status.value1 && rtx_equal_p (dest, cc_status.value1)) ||	      \
+	  (cc_status.value2 && rtx_equal_p (dest, cc_status.value2)))	      \
 	CC_STATUS_INIT;							      \
       break;								      \
 									      \
@@ -1104,8 +1101,7 @@ Clipper operand formatting codes:
   ((CODE) == 'C')
 
 #define PRINT_OPERAND(FILE, X, CODE)  \
-{ extern char *rev_cond_name ();					\
-  if (CODE == 'C')							\
+{ if (CODE == 'C')							\
     fputs (rev_cond_name (X), FILE);					\
   else if (GET_CODE (X) == REG)						\
     fprintf (FILE, "%s", reg_names[REGNO (X)]);				\


More information about the Gcc-patches mailing list