This is the mail archive of the gcc-patches@gcc.gnu.org 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]

egcs CVS 19980621, warning patch part 3/7


	This is warning patch part 3/7.  Okay to install?




Sun Jun 21 16:39:30 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* reload1.c (reload_cse_regs): Cast first arg of `bzero' to char *.

	* sdbout.c: Include output.h and toplev.h.
	(PUT_SDB_INT_VAL): Use HOST_WIDE_INT_PRINT_DEV to print argument
	`a'.  Cast `a' to HOST_WIDE_INT to force it to always be so.
	(PUT_SDB_SIZE): Likewise.

	* sdbout.h (sdbout_mark_begin_function): Add prototype.

	* stmt.c (check_for_full_enumeration_handling): Cast argument of
	`warning' to long and use %ld specifier.

	* toplev.c (main): Likewise for `fprintf'.

	* toplev.h (output_file_directive): Add prototype.

	* unroll.c (unroll_loop): Use HOST_WIDE_INT_PRINT_DEC specifier in
	call to `fprintf'.
	(precondition_loop_p): Likewise.

	* varasm.c Include sdbout.h.
	(assemble_static_space): Move sometimes-unused variable `rounded'
	into the scope in which it is used. 

diff -rup orig/egcs-CVS19980621/gcc/reload1.c egcs-CVS19980621/gcc/reload1.c
--- orig/egcs-CVS19980621/gcc/reload1.c	Sun Jun 21 08:45:05 1998
+++ egcs-CVS19980621/gcc/reload1.c	Sun Jun 21 12:42:12 1998
@@ -8171,7 +8171,7 @@ reload_cse_regs (first)
   init_alias_analysis ();
 
   reg_values = (rtx *) alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx));
-  bzero (reg_values, FIRST_PSEUDO_REGISTER * sizeof (rtx));
+  bzero ((char *)reg_values, FIRST_PSEUDO_REGISTER * sizeof (rtx));
 
   /* Create our EXPR_LIST structures on reload_obstack, so that we can
      free them when we are done.  */
diff -rup orig/egcs-CVS19980621/gcc/sdbout.c egcs-CVS19980621/gcc/sdbout.c
--- orig/egcs-CVS19980621/gcc/sdbout.c	Sun Jun 21 08:45:08 1998
+++ egcs-CVS19980621/gcc/sdbout.c	Sun Jun 21 15:25:57 1998
@@ -52,6 +52,8 @@ AT&T C compiler.  From the example below
 #include "flags.h"
 #include "insn-config.h"
 #include "reload.h"
+#include "output.h"
+#include "toplev.h"
 
 /* Mips systems use the SDB functions to dump out symbols, but do not
    supply usable syms.h include files.  Which syms.h file to use is a
@@ -171,7 +173,13 @@ static void sdbout_reg_parms		PROTO((tre
 #endif
 
 #ifndef PUT_SDB_INT_VAL
-#define PUT_SDB_INT_VAL(a) fprintf (asm_out_file, "\t.val\t%d%s", (a), SDB_DELIM)
+#define PUT_SDB_INT_VAL(a) \
+ do {									\
+   fputs ("\t.val\t", asm_out_file);		       			\
+   fprintf (asm_out_file, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)(a));	\
+   fprintf (asm_out_file, "%s", SDB_DELIM);				\
+ } while (0)
+
 #endif
 
 #ifndef PUT_SDB_VAL
@@ -201,7 +209,12 @@ do { fprintf (asm_out_file, "\t.def\t");
 #endif
 
 #ifndef PUT_SDB_SIZE
-#define PUT_SDB_SIZE(a) fprintf(asm_out_file, "\t.size\t%d%s", a, SDB_DELIM)
+#define PUT_SDB_SIZE(a) \
+ do {									\
+   fputs ("\t.size\t", asm_out_file);					\
+   fprintf (asm_out_file, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)(a));	\
+   fprintf (asm_out_file, "%s", SDB_DELIM);				\
+ } while(0)
 #endif
 
 #ifndef PUT_SDB_START_DIM
diff -rup orig/egcs-CVS19980621/gcc/sdbout.h egcs-CVS19980621/gcc/sdbout.h
--- orig/egcs-CVS19980621/gcc/sdbout.h	Sun Jun 21 08:49:54 1998
+++ egcs-CVS19980621/gcc/sdbout.h	Sun Jun 21 15:18:34 1998
@@ -35,4 +35,5 @@ extern void sdbout_end_epilogue		PROTO (
 
 extern void sdbout_start_new_source_file 	PROTO ((char *));
 extern void sdbout_resume_previous_source_file	PROTO ((void));
+extern void sdbout_mark_begin_function	PROTO ((void));
 
diff -rup orig/egcs-CVS19980621/gcc/stmt.c egcs-CVS19980621/gcc/stmt.c
--- orig/egcs-CVS19980621/gcc/stmt.c	Sun Jun 21 08:45:09 1998
+++ egcs-CVS19980621/gcc/stmt.c	Sun Jun 21 13:14:10 1998
@@ -4524,11 +4524,11 @@ check_for_full_enumeration_handling (typ
 	if (!chain)
 	  {
 	    if (TYPE_NAME (type) == 0)
-	      warning ("case value `%d' not in enumerated type",
-		       TREE_INT_CST_LOW (n->low));
+	      warning ("case value `%ld' not in enumerated type",
+		       (long) TREE_INT_CST_LOW (n->low));
 	    else
-	      warning ("case value `%d' not in enumerated type `%s'",
-		       TREE_INT_CST_LOW (n->low),
+	      warning ("case value `%ld' not in enumerated type `%s'",
+		       (long) TREE_INT_CST_LOW (n->low),
 		       IDENTIFIER_POINTER ((TREE_CODE (TYPE_NAME (type))
 					    == IDENTIFIER_NODE)
 					   ? TYPE_NAME (type)
@@ -4544,11 +4544,11 @@ check_for_full_enumeration_handling (typ
 	    if (!chain)
 	      {
 		if (TYPE_NAME (type) == 0)
-		  warning ("case value `%d' not in enumerated type",
-			   TREE_INT_CST_LOW (n->high));
+		  warning ("case value `%ld' not in enumerated type",
+			   (long) TREE_INT_CST_LOW (n->high));
 		else
-		  warning ("case value `%d' not in enumerated type `%s'",
-			   TREE_INT_CST_LOW (n->high),
+		  warning ("case value `%ld' not in enumerated type `%s'",
+			   (long) TREE_INT_CST_LOW (n->high),
 			   IDENTIFIER_POINTER ((TREE_CODE (TYPE_NAME (type))
 						== IDENTIFIER_NODE)
 					       ? TYPE_NAME (type)
diff -rup orig/egcs-CVS19980621/gcc/toplev.c egcs-CVS19980621/gcc/toplev.c
--- orig/egcs-CVS19980621/gcc/toplev.c	Sun Jun 21 08:45:13 1998
+++ egcs-CVS19980621/gcc/toplev.c	Sun Jun 21 13:53:57 1998
@@ -4410,8 +4410,7 @@ main (argc, argv, envp)
     {
       char *lim = (char *) sbrk (0);
 
-      fprintf (stderr, "Data size %d.\n",
-	       lim - (char *) &environ);
+      fprintf (stderr, "Data size %ld.\n", (long)(lim - (char *) &environ));
       fflush (stderr);
 
 #ifndef __MSDOS__
diff -rup orig/egcs-CVS19980621/gcc/toplev.h egcs-CVS19980621/gcc/toplev.h
--- orig/egcs-CVS19980621/gcc/toplev.h	Sun Jun 21 08:49:53 1998
+++ egcs-CVS19980621/gcc/toplev.h	Sun Jun 21 15:25:29 1998
@@ -57,6 +57,7 @@ extern void set_float_handler PROTO((jmp
 
 #ifdef BUFSIZ
 extern void output_quoted_string	PROTO ((FILE *, char *));
+extern void output_file_directive	PROTO ((FILE *, char *));
 #endif
 
 #endif /* __GCC_TOPLEV_H */
diff -rup orig/egcs-CVS19980621/gcc/unroll.c egcs-CVS19980621/gcc/unroll.c
--- orig/egcs-CVS19980621/gcc/unroll.c	Sun Jun 21 08:45:15 1998
+++ egcs-CVS19980621/gcc/unroll.c	Sun Jun 21 13:49:37 1998
@@ -313,8 +313,11 @@ unroll_loop (loop_end, insn_count, loop_
     loop_n_iterations = 0;
 
   if (loop_dump_stream && loop_n_iterations > 0)
-    fprintf (loop_dump_stream,
-	     "Loop unrolling: %d iterations.\n", loop_n_iterations);
+    {
+      fputs ("Loop unrolling: ", loop_dump_stream);
+      fprintf (loop_dump_stream, HOST_WIDE_INT_PRINT_DEC, loop_n_iterations);
+      fputs (" iterations.\n", loop_dump_stream);
+    }
 
   /* Find and save a pointer to the last nonnote insn in the loop.  */
 
@@ -1312,9 +1315,13 @@ precondition_loop_p (initial_value, fina
       *final_value = GEN_INT (loop_n_iterations);
 
       if (loop_dump_stream)
-	fprintf (loop_dump_stream,
-		 "Preconditioning: Success, number of iterations known, %d.\n",
-		 loop_n_iterations);
+	{
+	  fputs ("Preconditioning: Success, number of iterations known, ",
+		 loop_dump_stream);
+	  fprintf (loop_dump_stream, HOST_WIDE_INT_PRINT_DEC,
+		   loop_n_iterations);
+	  fputs (".\n", loop_dump_stream);
+	}
       return 1;
     }
 
diff -rup orig/egcs-CVS19980621/gcc/varasm.c egcs-CVS19980621/gcc/varasm.c
--- orig/egcs-CVS19980621/gcc/varasm.c	Sun Jun 21 08:45:15 1998
+++ egcs-CVS19980621/gcc/varasm.c	Sun Jun 21 15:17:53 1998
@@ -43,6 +43,7 @@ Boston, MA 02111-1307, USA.  */
 #include "real.h"
 #include "toplev.h"
 #include "dbxout.h"
+#include "sdbout.h"
 
 #include "obstack.h"
 #include "c-pragma.h"
@@ -1683,13 +1684,6 @@ assemble_static_space (size)
   char name[12];
   char *namestring;
   rtx x;
-#ifndef ASM_OUTPUT_ALIGNED_LOCAL
-  /* Round size up to multiple of BIGGEST_ALIGNMENT bits
-     so that each uninitialized object starts on such a boundary.  */
-  int rounded = ((size + (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1)
-		 / (BIGGEST_ALIGNMENT / BITS_PER_UNIT)
-		 * (BIGGEST_ALIGNMENT / BITS_PER_UNIT));
-#endif
 
 #if 0
   if (flag_shared_data)
@@ -1712,7 +1706,14 @@ assemble_static_space (size)
 #ifdef ASM_OUTPUT_ALIGNED_LOCAL
   ASM_OUTPUT_ALIGNED_LOCAL (asm_out_file, name, size, BIGGEST_ALIGNMENT);
 #else
-  ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded);
+  {
+    /* Round size up to multiple of BIGGEST_ALIGNMENT bits
+       so that each uninitialized object starts on such a boundary.  */
+    int rounded = ((size + (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1)
+		   / (BIGGEST_ALIGNMENT / BITS_PER_UNIT)
+		   * (BIGGEST_ALIGNMENT / BITS_PER_UNIT));
+    ASM_OUTPUT_LOCAL (asm_out_file, name, size, rounded);
+  }
 #endif
 #endif
   return x;


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