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]
Other format: [Raw text]

Patch installed for remaining varasm.c warnings


This patch fixes the remaining warnings from varasm.c that I could
find and fix by building a cross-compiler.

The only bit that isn't clear from inspection is the
mvs_function_name_length change to size_t.  That variable is only ever
set to or compared with another size_t (strlen), or passed to xmalloc.
The comparison with a strlen necessated the fix.  The other changes
should be clear.

Tested in my target farm and installed as obvious.

		--Kaveh


2003-06-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* i370.c (mvs_function_name_length): Fix signed/unsigned warnings. 
	* i370.h (mvs_function_name_length): Likewise.
	* i960.h (CONSTANT_ALIGNMENT): Likewise.
	* mips/linux.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
	* pa/pa-pro-end.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
	* pa.h (ASM_OUTPUT_ALIGNED_COMMON): Likewise.
	* rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Delete unused
	variable.

diff -rup orig/egcc-CVS20030602/gcc/config/i370/i370.c egcc-CVS20030602/gcc/config/i370/i370.c
--- orig/egcc-CVS20030602/gcc/config/i370/i370.c	2003-05-16 17:30:20.000000000 -0400
+++ egcc-CVS20030602/gcc/config/i370/i370.c	2003-06-04 10:42:13.777614000 -0400
@@ -85,7 +85,7 @@ int mvs_page_lit;
 char *mvs_function_name = 0;
 
 /* Current function name length.  */
-int mvs_function_name_length = 0;
+size_t mvs_function_name_length = 0;
 
 /* Page number for multi-page functions.  */
 int mvs_page_num = 0;
diff -rup orig/egcc-CVS20030602/gcc/config/i370/i370.h egcc-CVS20030602/gcc/config/i370/i370.h
--- orig/egcc-CVS20030602/gcc/config/i370/i370.h	2003-05-16 17:30:20.000000000 -0400
+++ egcc-CVS20030602/gcc/config/i370/i370.h	2003-06-04 10:42:07.988001000 -0400
@@ -54,7 +54,7 @@ extern char *mvs_function_name;
 
 /* The length of the function name malloc'd area.  */
 
-extern int mvs_function_name_length;
+extern size_t mvs_function_name_length;
 
 /* Compile using char instructions (mvc, nc, oc, xc).  On 4341 use this since
    these are more than twice as fast as load-op-store.
diff -rup orig/egcc-CVS20030602/gcc/config/i960/i960.h egcc-CVS20030602/gcc/config/i960/i960.h
--- orig/egcc-CVS20030602/gcc/config/i960/i960.h	2003-05-17 18:09:06.000000000 -0400
+++ egcc-CVS20030602/gcc/config/i960/i960.h	2003-06-04 10:18:36.979275000 -0400
@@ -422,9 +422,9 @@ extern int target_flags;
    library functions.  */
 #define CONSTANT_ALIGNMENT(EXP, ALIGN) \
   (TREE_CODE (EXP) == STRING_CST	\
-   && i960_object_bytes_bitalign (int_size_in_bytes (TREE_TYPE (EXP))) > (ALIGN) \
+   && i960_object_bytes_bitalign (int_size_in_bytes (TREE_TYPE (EXP))) > (int)(ALIGN) \
    ? i960_object_bytes_bitalign (int_size_in_bytes (TREE_TYPE (EXP)))	    \
-   : (ALIGN))
+   : (int)(ALIGN))
 
 /* Macros to determine size of aggregates (structures and unions
    in C).  Normally, these may be defined to simply return the maximum
diff -rup orig/egcc-CVS20030602/gcc/config/mips/linux.h egcc-CVS20030602/gcc/config/mips/linux.h
--- orig/egcc-CVS20030602/gcc/config/mips/linux.h	2003-05-28 20:01:41.000000000 -0400
+++ egcc-CVS20030602/gcc/config/mips/linux.h	2003-06-04 10:51:02.760548000 -0400
@@ -46,7 +46,7 @@ Boston, MA 02111-1307, USA.  */
    `varasm.c' when defining this macro.  */
 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN)	\
 do {								\
-  if (SIZE > 0 && SIZE <= mips_section_threshold)		\
+  if (SIZE > 0 && (long)(SIZE) <= mips_section_threshold)	\
     sbss_section ();						\
   else								\
     bss_section ();						\
diff -rup orig/egcc-CVS20030602/gcc/config/pa/pa-pro-end.h egcc-CVS20030602/gcc/config/pa/pa-pro-end.h
--- orig/egcc-CVS20030602/gcc/config/pa/pa-pro-end.h	2003-05-12 20:02:18.000000000 -0400
+++ egcc-CVS20030602/gcc/config/pa/pa-pro-end.h	2003-06-04 12:01:18.194328000 -0400
@@ -64,7 +64,7 @@ Boston, MA 02111-1307, USA.  */
 { bss_section ();							\
   assemble_name ((FILE), (NAME));					\
   fprintf ((FILE), "\t.comm "HOST_WIDE_INT_PRINT_UNSIGNED"\n",		\
-	   MAX ((SIZE), ((ALIGNED) / BITS_PER_UNIT)));}
+	   MAX ((HOST_WIDE_INT)(SIZE), (HOST_WIDE_INT)((ALIGNED) / BITS_PER_UNIT)));}
 
 /* This says how to output an assembler line to define a local common symbol
    with size SIZE (in bytes) and alignment ALIGN (in bits).  */
diff -rup orig/egcc-CVS20030602/gcc/config/pa/pa.h egcc-CVS20030602/gcc/config/pa/pa.h
--- orig/egcc-CVS20030602/gcc/config/pa/pa.h	2003-05-16 14:53:59.000000000 -0400
+++ egcc-CVS20030602/gcc/config/pa/pa.h	2003-06-04 11:53:05.472379000 -0400
@@ -1757,7 +1757,7 @@ do { 									\
 { bss_section ();							\
   assemble_name ((FILE), (NAME));					\
   fprintf ((FILE), "\t.comm "HOST_WIDE_INT_PRINT_UNSIGNED"\n",		\
-	   MAX ((SIZE), ((ALIGNED) / BITS_PER_UNIT)));}
+	   MAX ((HOST_WIDE_INT)(SIZE), (HOST_WIDE_INT)((ALIGNED) / BITS_PER_UNIT)));}
 
 /* This says how to output an assembler line to define a local common symbol
    with size SIZE (in bytes) and alignment ALIGN (in bits).  */
diff -rup orig/egcc-CVS20030602/gcc/config/rs6000/xcoff.h egcc-CVS20030602/gcc/config/rs6000/xcoff.h
--- orig/egcc-CVS20030602/gcc/config/rs6000/xcoff.h	2003-05-12 20:02:27.000000000 -0400
+++ egcc-CVS20030602/gcc/config/rs6000/xcoff.h	2003-06-04 09:56:20.026846000 -0400
@@ -258,8 +258,7 @@ toc_section ()						\
    are placeholders which no longer have any use.  */
 
 #define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL)		\
-{ rtx sym_ref = XEXP (DECL_RTL (DECL), 0);			\
-  if (TREE_PUBLIC (DECL))					\
+{ if (TREE_PUBLIC (DECL))					\
     {								\
       if (!RS6000_WEAK || !DECL_WEAK (decl))			\
 	{							\


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