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]

Warning fix patch for i386.c


Kaveh R. Ghazi wrote:

[ guidelines for 'sytem.h'-izing a file ] 

> header or autoconf stuff,) and also some of config/*/*.c.  I'm working
> on those config/ dir files which I can test.  The i386 stuff is not
> among them.

[ munch ] 

> But if people with other platforms where these run native would like
> to help, they are welcome to (there are lots of these files.)
>
>       Note you don't have to update Makefile.in dependencies for
> $out_object_file, I did that the first time I converted a config/ dir
> file so all of them have this.


I'm leaving town for a week, so considering the turnaround time on the
list, it's unlikely that this will be approved before I leave.  As such,
if someone that has an interest in such things would like to do the final
polish and commit, that would get this in sooner.

I'll confess that when I made earlier passes over i386.c, I had
'-Wno-unused' so I never saw these. But this brings the number of
warnings in that file to zero.

ChangeLog:

        * config/i386/i386.c: Include system.h.   Remove redundant includes.
        (optimization_options): Mark param 'size' with ATTRIBUTE_UNUSED.
        (i386_cc_probably_useless_p): Likewise for 'decl', 'attributes',
        'identifier', 'args'.
        (i386_valid_type_attribute_p): Likewise for 'attributes'.
        (i386_comp_type_attribute_p): Likewise for 'type1', 'type2'.
        (function_arg_partial_nregs): Likewise for 'cum', 'mode', 'type',
        and 'named'.
        (symbolic_operand): Likewise for 'mode'.
        (call_insn_operand): Likewise.
        (expander_call_insn_operand): Likewise.
        (ix86_logical_operator): Likewise.
        (ix86_binary_operator_ok): Likewise.
        (emit_pic_move): Likewise.
        (VOIDmode_compare_op): Likewise.
        (is_mul): Likewise.
        (str_immediate_operand): Likewise.
        (ix86_uary_operator_ok): Likewise for 'code', 'mode', and 'operands'.yy
        (asm_output_function_prefix): Likewise for 'name'.
        (function_prologue): Likewise for 'file', and 'size'.
        (function_epilogue): Likewise.


Index: i386.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.30
diff -u -p -r1.30 i386.c
--- i386.c	1998/06/19 01:20:42	1.30
+++ i386.c	1998/06/19 18:30:28
@@ -18,10 +18,9 @@ along with GNU CC; see the file COPYING.
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA. */
 
-#include <stdio.h>
 #include <setjmp.h>
-#include <ctype.h>
 #include "config.h"
+#include "system.h"
 #include "rtl.h"
 #include "regs.h"
 #include "hard-reg-set.h"
@@ -39,18 +38,6 @@ Boston, MA 02111-1307, USA. */
 #include "expr.h"
 #include "toplev.h"
 
-#if HAVE_STDLIB_H
-#include <stdlib.h>                                                
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>                                                   
-#else                                                  
-#ifdef HAVE_STRINGS_H
-#include <strings.h>               
-#endif                                                                   
-#endif 
-
 #ifdef EXTRA_CONSTRAINT
 /* If EXTRA_CONSTRAINT is defined, then the 'S'
    constraint in REG_CLASS_FROM_LETTER will no longer work, and various
@@ -438,7 +425,7 @@ order_regs_for_local_alloc ()
 void
 optimization_options (level, size)
      int level;
-     int size;
+     int size ATTRIBUTE_UNUSED;
 {
   /* For -O2 and beyond, turn off -fschedule-insns by default.  It tends to
      make the problem with not enough registers even worse.  */
@@ -539,10 +526,10 @@ i386_cc_probably_useless_p (insn)
 
 int
 i386_valid_decl_attribute_p (decl, attributes, identifier, args)
-     tree decl;
-     tree attributes;
-     tree identifier;
-     tree args;
+     tree decl ATTRIBUTE_UNUSED;
+     tree attributes ATTRIBUTE_UNUSED;
+     tree identifier ATTRIBUTE_UNUSED;
+     tree args ATTRIBUTE_UNUSED;
 {
   return 0;
 }
@@ -554,7 +541,7 @@ i386_valid_decl_attribute_p (decl, attri
 int
 i386_valid_type_attribute_p (type, attributes, identifier, args)
      tree type;
-     tree attributes;
+     tree attributes ATTRIBUTE_UNUSED;
      tree identifier;
      tree args;
 {
@@ -604,8 +591,8 @@ i386_valid_type_attribute_p (type, attri
 
 int
 i386_comp_type_attributes (type1, type2)
-     tree type1;
-     tree type2;
+     tree type1 ATTRIBUTE_UNUSED;
+     tree type2 ATTRIBUTE_UNUSED;
 {
   return 1;
 }
@@ -818,10 +805,10 @@ function_arg (cum, mode, type, named)
 
 int
 function_arg_partial_nregs (cum, mode, type, named)
-     CUMULATIVE_ARGS *cum;	/* current arg information */
-     enum machine_mode mode;	/* current arg mode */
-     tree type;			/* type of the argument or 0 if lib support */
-     int named;			/* != 0 for normal args, == 0 for ... args */
+     CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED;	/* current arg information */
+     enum machine_mode mode ATTRIBUTE_UNUSED;	/* current arg mode */
+     tree type ATTRIBUTE_UNUSED;		/* type of the argument or 0 if lib support */
+     int named ATTRIBUTE_UNUSED;		/* != 0 for normal args, == 0 for ... args */
 {
   return 0;
 }
@@ -1628,7 +1615,7 @@ output_move_const_single (operands)
 int
 symbolic_operand (op, mode)
      register rtx op;
-     enum machine_mode mode;
+     enum machine_mode mode ATTRIBUTE_UNUSED;
 {
   switch (GET_CODE (op))
     {
@@ -1655,7 +1642,7 @@ symbolic_operand (op, mode)
 int
 call_insn_operand (op, mode)
      rtx op;
-     enum machine_mode mode;
+     enum machine_mode mode ATTRIBUTE_UNUSED;
 {
   if (GET_CODE (op) == MEM
       && ((CONSTANT_ADDRESS_P (XEXP (op, 0))
@@ -1676,7 +1663,7 @@ call_insn_operand (op, mode)
 int
 expander_call_insn_operand (op, mode)
      rtx op;
-     enum machine_mode mode;
+     enum machine_mode mode ATTRIBUTE_UNUSED;
 {
   if (GET_CODE (op) == MEM
       && (CONSTANT_ADDRESS_P (XEXP (op, 0))
@@ -1712,7 +1699,7 @@ arithmetic_comparison_operator (op, mode
 int
 ix86_logical_operator (op, mode)
      register rtx op;
-     enum machine_mode mode;
+     enum machine_mode mode ATTRIBUTE_UNUSED;
 {
   return GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR;
 }
@@ -1841,7 +1828,7 @@ ix86_expand_binary_operator (code, mode,
 int
 ix86_binary_operator_ok (code, mode, operands)
      enum rtx_code code;
-     enum machine_mode mode;
+     enum machine_mode mode ATTRIBUTE_UNUSED;
      rtx operands[3];
 {
   return (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)
@@ -1888,9 +1875,9 @@ ix86_expand_unary_operator (code, mode, 
 
 int
 ix86_unary_operator_ok (code, mode, operands)
-     enum rtx_code code;
-     enum machine_mode mode;
-     rtx operands[2];
+     enum rtx_code code ATTRIBUTE_UNUSED;
+     enum machine_mode mode ATTRIBUTE_UNUSED;
+     rtx operands[2] ATTRIBUTE_UNUSED;
 {
   return TRUE;
 }
@@ -1905,7 +1892,7 @@ static int pic_label_no = 0;
 void
 asm_output_function_prefix (file, name)
      FILE *file;
-     char *name;
+     char *name ATTRIBUTE_UNUSED;
 {
   rtx xops[2];
   int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
@@ -1941,8 +1928,8 @@ asm_output_function_prefix (file, name)
 
 void
 function_prologue (file, size)
-     FILE *file;
-     int size;
+     FILE *file ATTRIBUTE_UNUSED;
+     int size ATTRIBUTE_UNUSED;
 {
   if (TARGET_SCHEDULE_PROLOGUE)
     {
@@ -2229,8 +2216,8 @@ ix86_can_use_return_insn_p ()
 
 void
 function_epilogue (file, size)
-     FILE *file;
-     int size;
+     FILE *file ATTRIBUTE_UNUSED;
+     int size ATTRIBUTE_UNUSED;
 {
     return;
 }
@@ -2761,7 +2748,7 @@ legitimize_pic_address (orig, reg)
 void
 emit_pic_move (operands, mode)
      rtx *operands;
-     enum machine_mode mode;
+     enum machine_mode mode ATTRIBUTE_UNUSED;
 {
   rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
 
@@ -2795,7 +2782,7 @@ emit_pic_move (operands, mode)
 rtx
 legitimize_address (x, oldx, mode)
      register rtx x;
-     register rtx oldx;
+     register rtx oldx ATTRIBUTE_UNUSED;
      enum machine_mode mode;
 {
   int changed = 0;
@@ -3805,7 +3792,7 @@ shift_op (op, mode)
 int
 VOIDmode_compare_op (op, mode)
     register rtx op;
-    enum machine_mode mode;
+    enum machine_mode mode ATTRIBUTE_UNUSED;
 {
   return GET_CODE (op) == COMPARE && GET_MODE (op) == VOIDmode;
 }
@@ -4333,14 +4320,14 @@ assign_386_stack_local (mode, n)
 
 int is_mul(op,mode)
     register rtx op;
-    enum machine_mode mode;
+    enum machine_mode mode ATTRIBUTE_UNUSED;
 {
   return (GET_CODE (op) == MULT);
 }
 
 int is_div(op,mode)
     register rtx op;
-    enum machine_mode mode;
+    enum machine_mode mode ATTRIBUTE_UNUSED;
 {
   return (GET_CODE (op) == DIV);
 }
@@ -4811,7 +4798,7 @@ sets_condition_code (pat)
 int
 str_immediate_operand (op, mode)
      register rtx op;
-     enum machine_mode mode;
+     enum machine_mode mode ATTRIBUTE_UNUSED;
 {
   if (GET_CODE (op) == CONST_INT && INTVAL (op) <= 32 && INTVAL (op) >= 0)
     return 1;


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