]> gcc.gnu.org Git - gcc.git/commitdiff
Warning fixes:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Wed, 23 Dec 1998 07:09:01 +0000 (07:09 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Wed, 23 Dec 1998 07:09:01 +0000 (07:09 +0000)
        * alias.c (record_alias_subset): Remove ignored `&'.
        (init_alias_once): Likewise.
        * c-lex.c (UNGETC): Cast first argument of comma expression to void.
        * config/mips/mips.c (mips_asm_file_end): Cast the result of
        fwrite to `int' when comparing against one.
        * config/mips/mips.h (CAN_ELIMINATE): Add parens around && within ||.
        (INITIAL_ELIMINATION_OFFSET): Add braces to avoid ambiguous `else'.
        * cse.c (rehash_using_reg): Change type of variable `i' to
        unsigned int.
        * dwarf2out.c (initial_return_save): Cast -1 to unsigned before
        assigning it to one.
        * except.c (duplicate_eh_handlers): Remove unused variable `tmp'.
        * final.c (final_scan_insn): Likewise for variable `i'.
        (output_asm_insn): Cast a char to unsigned char when used as an
        array index.
        * gcse.c (compute_pre_ppinout): Cast -1 to SBITMAP_ELT_TYPE when
        assigning it to one.
        * loop.c (strength_reduce): Remove unused variables `count' and `temp'.
        * recog.c (preprocess_constraints): Cast a char to unsigned char
        when used as an array index.
        * regmove.c (find_matches): Likewise.
        * reload1.c (calculate_needs): Add default case in switch.
        (eliminate_regs_in_insn): Initialize variable `offset'.
        (set_offsets_for_label): Change type of variable `i' to unsigned.
        (reload_as_needed): Wrap variable `i' in macro check on
        AUTO_INC_DEC || INSN_CLOBBERS_REGNO_P.
        * scan-decls.c (scan_decls): Mark parameters `argc' and `argv'
        with ATTRIBUTE_UNUSED.  Cast variable `start_written' to size_t
        when comparing against one.
        * stor-layout.c (layout_decl): Cast maximum_field_alignment to
        unsigned when comparing against one.  Likewise for
        GET_MODE_ALIGNMENT().
        (layout_record): Cast record_align to int when comparing against a
        signed value.
        (layout_type): Cast TYPE_ALIGN() to int when comparing against a
        signed value.
        * tree.c (get_identifier): Cast variable `len' to unsigned when
        comparing against one.
        (maybe_get_identifier): Likewise

From-SVN: r24403

17 files changed:
gcc/ChangeLog
gcc/alias.c
gcc/c-lex.c
gcc/config/mips/mips.c
gcc/config/mips/mips.h
gcc/cse.c
gcc/dwarf2out.c
gcc/except.c
gcc/final.c
gcc/gcse.c
gcc/loop.c
gcc/recog.c
gcc/regmove.c
gcc/reload1.c
gcc/scan-decls.c
gcc/stor-layout.c
gcc/tree.c

index 0384fbc25a2c38d3f78aae10c55c00bc4ee091b4..5d14e878cfdd000a500b7a66c245cd34193639de 100644 (file)
@@ -1,3 +1,60 @@
+Wed Dec 23 09:51:32 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * alias.c (record_alias_subset): Remove ignored `&'.
+       (init_alias_once): Likewise.
+
+       * c-lex.c (UNGETC): Cast first argument of comma expression to void.
+
+       * config/mips/mips.c (mips_asm_file_end): Cast the result of
+       fwrite to `int' when comparing against one.
+
+       * config/mips/mips.h (CAN_ELIMINATE): Add parens around && within ||.
+       (INITIAL_ELIMINATION_OFFSET): Add braces to avoid ambiguous `else'.
+
+       * cse.c (rehash_using_reg): Change type of variable `i' to
+       unsigned int.
+
+       * dwarf2out.c (initial_return_save): Cast -1 to unsigned before
+       assigning it to one.
+
+       * except.c (duplicate_eh_handlers): Remove unused variable `tmp'.
+
+       * final.c (final_scan_insn): Likewise for variable `i'.
+       (output_asm_insn): Cast a char to unsigned char when used as an
+       array index.
+
+       * gcse.c (compute_pre_ppinout): Cast -1 to SBITMAP_ELT_TYPE when
+       assigning it to one.
+
+       * loop.c (strength_reduce): Remove unused variables `count' and `temp'.
+
+       * recog.c (preprocess_constraints): Cast a char to unsigned char
+       when used as an array index.
+
+       * regmove.c (find_matches): Likewise.
+
+       * reload1.c (calculate_needs): Add default case in switch.
+       (eliminate_regs_in_insn): Initialize variable `offset'.
+       (set_offsets_for_label): Change type of variable `i' to unsigned.
+       (reload_as_needed): Wrap variable `i' in macro check on
+       AUTO_INC_DEC || INSN_CLOBBERS_REGNO_P.
+
+       * scan-decls.c (scan_decls): Mark parameters `argc' and `argv'
+       with ATTRIBUTE_UNUSED.  Cast variable `start_written' to size_t
+       when comparing against one.
+
+       * stor-layout.c (layout_decl): Cast maximum_field_alignment to
+       unsigned when comparing against one.  Likewise for
+       GET_MODE_ALIGNMENT().
+       (layout_record): Cast record_align to int when comparing against a
+       signed value. 
+       (layout_type): Cast TYPE_ALIGN() to int when comparing against a
+       signed value.
+
+       * tree.c (get_identifier): Cast variable `len' to unsigned when
+       comparing against one.
+       (maybe_get_identifier): Likewise
+
 Wed Dec 23 00:10:01 1998  Jeffrey A Law  (law@cygnus.com)
 
        * toplev.c (rest_of_compilation): Do not set reload_completed.
index ce5a499436535ac1d8538d36eed205933c6ffc93..1adc8b31071eff4f8f2d0ddfcde8ea5e4779b51c 100644 (file)
@@ -302,7 +302,7 @@ record_alias_subset (superset, subset)
        (alias_set_entry) xmalloc (sizeof (struct alias_set_entry));
       superset_entry->alias_set = superset;
       superset_entry->children 
-       = splay_tree_new (&alias_set_compare, 0, 0);
+       = splay_tree_new (alias_set_compare, 0, 0);
       splay_tree_insert (alias_sets, 
                         (splay_tree_key) superset,
                         (splay_tree_value) superset_entry);
@@ -314,7 +314,7 @@ record_alias_subset (superset, subset)
     /* There is an entry for the subset.  Enter all of its children
        (if they are not already present) as children of the SUPERSET.  */
     splay_tree_foreach (subset_entry->children,
-                       &insert_subset_children,
+                       insert_subset_children,
                        superset_entry->children);
 
   /* Enter the SUBSET itself as a child of the SUPERSET.  */
@@ -1295,7 +1295,7 @@ init_alias_once ()
        && HARD_REGNO_MODE_OK (i, Pmode))
       SET_HARD_REG_BIT (argument_registers, i);
 
-  alias_sets = splay_tree_new (&alias_set_compare, 0, 0);
+  alias_sets = splay_tree_new (alias_set_compare, 0, 0);
 }
 
 void
index 54c834f92b60b48a27ac91e8db0f747a92c5385a..1b44817dbc787e0a0606281f4cc666a586057890 100644 (file)
@@ -63,7 +63,7 @@ extern unsigned char *yy_cur, *yy_lim;
 extern int yy_get_token ();
 
 #define GETC() (yy_cur < yy_lim ? *yy_cur++ : yy_get_token ())
-#define UNGETC(c) ((c), yy_cur--)
+#define UNGETC(c) ((void)(c), yy_cur--)
 #else
 #define GETC() getc (finput)
 #define UNGETC(c) ungetc (c, finput)
index cf6ec55967272fb75745eebb64c9a610e624eab9..d713550f68b1f0194f4e9cc1f4d3011a2ccef42d 100644 (file)
@@ -5326,7 +5326,7 @@ mips_asm_file_end (file)
        fatal_io_error (temp_filename);
 
       while ((len = fread (buffer, 1, sizeof (buffer), asm_out_text_file)) > 0)
-       if (fwrite (buffer, 1, len, file) != len)
+       if ((int) fwrite (buffer, 1, len, file) != len)
          pfatal_with_name (asm_file_name);
 
       if (len < 0)
index edf6399f3bd4a9ea747b7071fde25b434a038a8b..c0e543846a226c2209ec65d2c9c59a2de53d3f35 100644 (file)
@@ -2180,7 +2180,7 @@ extern struct mips_frame_info current_frame_info;
 
 #define CAN_ELIMINATE(FROM, TO)                                                \
   (((FROM) == RETURN_ADDRESS_POINTER_REGNUM && (! leaf_function_p ()   \
-   || TO == GP_REG_FIRST + 31 && leaf_function_p))                     \
+   || (TO == GP_REG_FIRST + 31 && leaf_function_p)))                           \
   || ((FROM) != RETURN_ADDRESS_POINTER_REGNUM                          \
    && ((TO) == HARD_FRAME_POINTER_REGNUM                               \
    || ((TO) == STACK_POINTER_REGNUM && ! frame_pointer_needed          \
@@ -2219,11 +2219,13 @@ extern struct mips_frame_info current_frame_info;
   /* Some ABIs store 64 bits to the stack, but Pmode is 32 bits,        \
      so we must add 4 bytes to the offset to get the right value.  */   \
   else if ((FROM) == RETURN_ADDRESS_POINTER_REGNUM)                     \
+  {                                                                     \
    if (leaf_function_p ())                                              \
       (OFFSET) = 0;                                                     \
    else (OFFSET) = current_frame_info.gp_sp_offset                      \
               + ((UNITS_PER_WORD - (POINTER_SIZE / BITS_PER_UNIT))      \
                  * (BYTES_BIG_ENDIAN != 0));                            \
+  }                                                                     \
 }
 
 /* If we generate an insn to push BYTES bytes,
index 5e7763188e5bff136f4ebce76835f4c1eb040548..2ef26a5e934dcc6a9fd3a858b8da9eac7bde89d8 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -1772,7 +1772,7 @@ static void
 rehash_using_reg (x)
      rtx x;
 {
-  int i;
+  unsigned int i;
   struct table_elt *p, *next;
   unsigned hash;
 
index 3c59c3f14a907318edd092a9a2c93e66a3bbb881..98f5ac935e6c0f4610944f53b560d66d84f4a005 100644 (file)
@@ -1040,7 +1040,7 @@ static void
 initial_return_save (rtl)
      register rtx rtl;
 {
-  unsigned reg = -1;
+  unsigned int reg = (unsigned int) -1;
   long offset = 0;
 
   switch (GET_CODE (rtl))
index 2488d58772ba98f3e1947c82e7806763ebec590a..60e0d3caadff1b21f07f064582226866b088f269 100644 (file)
@@ -982,7 +982,6 @@ duplicate_eh_handlers (old_note_eh_region, new_note_eh_region, map)
 {
   struct handler_info *ptr, *new_ptr;
   int new_region, region;
-  rtx tmp;
 
   region = find_func_region (old_note_eh_region);
   if (region == -1)
index 066b621e9a823ddf5b636645cfda970705fe2646..461f605f0b652b8bc2298d5e74e6fd585d361274 100644 (file)
@@ -2035,7 +2035,6 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
      int prescan;
      int nopeepholes;
 {
-  register int i;
 #ifdef HAVE_cc0
   rtx set;
 #endif
@@ -3486,7 +3485,7 @@ output_asm_insn (template, operands)
           punctuation character alone, with no operand.
           The PRINT_OPERAND macro decides what is actually done.  */
 #ifdef PRINT_OPERAND_PUNCT_VALID_P
-       else if (PRINT_OPERAND_PUNCT_VALID_P (*p))
+       else if (PRINT_OPERAND_PUNCT_VALID_P ((unsigned char)*p))
          output_operand (NULL_RTX, *p++);
 #endif
        else
index 06393dbb1a155c5145cd244df45ed106cbee4c54..7209d2b9a77aebc8c7d8367f8ef3e4c9688c58ee 100644 (file)
@@ -4258,7 +4258,7 @@ compute_pre_ppinout ()
            {
              int_list_ptr pred;
              SBITMAP_ELT_TYPE tmp = *antin & *pavin & (*antloc | (*transp & *ppout));
-             SBITMAP_ELT_TYPE pred_val = -1L;
+             SBITMAP_ELT_TYPE pred_val = (SBITMAP_ELT_TYPE) -1;
 
              for (pred = s_preds[bb]; pred != NULL; pred = pred->next)
                {
index dcae8d0c6f483d0d129b84e324fb10c6f2b09eb9..082fc8170604dcb8c96905993ca8d893086b7c09 100644 (file)
@@ -3927,10 +3927,8 @@ strength_reduce (scan_start, end, loop_top, insn_count,
                                                 &add_val, &mult_val,
                                                 &last_consec_insn))))
            {
-             int count;
              struct induction *v
                = (struct induction *) alloca (sizeof (struct induction));
-             rtx temp;
 
              /* If this is a library call, increase benefit.  */
              if (find_reg_note (p, REG_RETVAL, NULL_RTX))
index 19bc3b2bcf8940746fbb36b3e346b7ad7159d1fc..fa8c069b46e5e89619515e95c38a02fe7ad2fa24 100644 (file)
@@ -1908,7 +1908,7 @@ preprocess_constraints ()
                  break;
 
                default:
-                 op_alt[j].class = reg_class_subunion[(int) op_alt[j].class][(int) REG_CLASS_FROM_LETTER (c)];
+                 op_alt[j].class = reg_class_subunion[(int) op_alt[j].class][(int) REG_CLASS_FROM_LETTER ((unsigned char)c)];
                  break;
                }
            }
index 937241a5db2f2a0cecdf6411a392e6c47f575a30..69197a3387eaba5e03817e704e585b6116fca220 100644 (file)
@@ -1471,7 +1471,7 @@ find_matches (insn, matchp)
          case 'j': case 'k': case 'l': case 'p': case 'q': case 't': case 'u':
          case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B':
          case 'C': case 'D': case 'W': case 'Y': case 'Z':
-           if (CLASS_LIKELY_SPILLED_P (REG_CLASS_FROM_LETTER (c)))
+           if (CLASS_LIKELY_SPILLED_P (REG_CLASS_FROM_LETTER ((unsigned char)c)))
              likely_spilled[op_no] = 1;
            break;
          }
index b4cb69cc19d5bf84ee76dc2e24bb1b994c5f6192..39da06d6135b35c4199588195357d8c03759a7f3 100644 (file)
@@ -1532,6 +1532,8 @@ calculate_needs (chain)
        case RELOAD_FOR_OPADDR_ADDR:
          this_needs = &insn_needs.op_addr_reload;
          break;
+       default:
+         abort();
        }
 
       if (size > 1)
@@ -3249,7 +3251,7 @@ eliminate_regs_in_insn (insn, replace)
                && ep->to == HARD_FRAME_POINTER_REGNUM)
              {
                rtx src = SET_SRC (old_set);
-               int offset, ok = 0;
+               int offset = 0, ok = 0;
                rtx prev_insn, prev_set;
 
                if (src == ep->to_rtx)
@@ -3577,7 +3579,7 @@ static void
 set_offsets_for_label (insn)
      rtx insn;
 {
-  int i;
+  unsigned int i;
   int label_nr = CODE_LABEL_NUMBER (insn);
   struct elim_table *ep;
 
@@ -4153,7 +4155,9 @@ reload_as_needed (live_known)
      int live_known;
 {
   struct insn_chain *chain;
+#if defined (AUTO_INC_DEC) || defined (INSN_CLOBBERS_REGNO_P)
   register int i;
+#endif
   rtx x;
 
   bzero ((char *) spill_reg_rtx, sizeof spill_reg_rtx);
index 5b947a412e39716fa41ab248d7457bbd753d6fac..2c6f12ae7b44ce3980755256ca8fe1bca58248f9 100644 (file)
@@ -77,8 +77,8 @@ Here dname is the actual name being declared.
 int
 scan_decls (pfile, argc, argv)
      cpp_reader *pfile;
-     int argc;
-     char **argv;
+     int argc ATTRIBUTE_UNUSED;
+     char **argv ATTRIBUTE_UNUSED;
 {
   int saw_extern, saw_inline;
   int start_written;
@@ -169,7 +169,7 @@ scan_decls (pfile, argc, argv)
            }
          break;
        case CPP_OTHER:
-         if (CPP_WRITTEN (pfile) == start_written + 1
+         if (CPP_WRITTEN (pfile) == (size_t) start_written + 1
              && (CPP_PWRITTEN (pfile)[-1] == '*'
                  || CPP_PWRITTEN (pfile)[-1] == '&'))
            declarator_start = start_written;
index a9474476de8f27df54285f4989a1b88b42289dc4..1379811cea739307555a25d39370d6f53a585bab 100644 (file)
@@ -283,7 +283,8 @@ layout_decl (decl, known_align)
     {
       DECL_BIT_FIELD_TYPE (decl) = DECL_BIT_FIELD (decl) ? type : 0;
       if (maximum_field_alignment != 0)
-       DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), maximum_field_alignment);
+       DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl),
+                                (unsigned)maximum_field_alignment);
       else if (DECL_PACKED (decl))
        DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), BITS_PER_UNIT);
     }
@@ -299,7 +300,7 @@ layout_decl (decl, known_align)
       if (xmode != BLKmode
          && known_align % GET_MODE_ALIGNMENT (xmode) == 0)
        {
-         DECL_ALIGN (decl) = MAX (GET_MODE_ALIGNMENT (xmode),
+         DECL_ALIGN (decl) = MAX ((unsigned) GET_MODE_ALIGNMENT (xmode),
                                   DECL_ALIGN (decl));
          DECL_MODE (decl) = xmode;
          DECL_SIZE (decl) = size_int (GET_MODE_BITSIZE (xmode));
@@ -413,7 +414,7 @@ layout_record (rec)
             It does, however, affect the alignment of the next field
             within the structure.  */
          if (! integer_zerop (DECL_SIZE (field)))
-           record_align = MAX (record_align, desired_align);
+           record_align = MAX ((int)record_align, desired_align);
          else if (! DECL_PACKED (field))
            desired_align = TYPE_ALIGN (TREE_TYPE (field));
          /* A named bit field of declared type `int'
@@ -426,11 +427,11 @@ layout_record (rec)
              else if (DECL_PACKED (field))
                type_align = MIN (type_align, BITS_PER_UNIT);
 
-             record_align = MAX (record_align, type_align);
+             record_align = MAX ((int)record_align, type_align);
            }
        }
       else
-       record_align = MAX (record_align, desired_align);
+       record_align = MAX ((int)record_align, desired_align);
 #endif
 
       /* Does this field automatically have alignment it needs
@@ -913,7 +914,7 @@ layout_type (type)
                               MODE_INT, 1);
 
            if (STRICT_ALIGNMENT && TYPE_ALIGN (type) < BIGGEST_ALIGNMENT
-               && TYPE_ALIGN (type) < TREE_INT_CST_LOW (TYPE_SIZE (type))
+               && (int)TYPE_ALIGN (type) < TREE_INT_CST_LOW (TYPE_SIZE (type))
                && TYPE_MODE (type) != BLKmode)
              {
                TYPE_NO_FORCE_BLK (type) = 1;
@@ -979,7 +980,7 @@ layout_type (type)
             then stick with BLKmode.  */
          if (STRICT_ALIGNMENT
              && ! (TYPE_ALIGN (type) >= BIGGEST_ALIGNMENT
-                   || (TYPE_ALIGN (type)
+                   || ((int)TYPE_ALIGN (type)
                        >= TREE_INT_CST_LOW (TYPE_SIZE (type)))))
            {
              if (TYPE_MODE (type) != BLKmode)
@@ -1011,7 +1012,7 @@ layout_type (type)
             then stick with BLKmode.  */
          && (! STRICT_ALIGNMENT
              || TYPE_ALIGN (type) >= BIGGEST_ALIGNMENT
-             || TYPE_ALIGN (type) >= TREE_INT_CST_LOW (TYPE_SIZE (type))))
+             || (int)TYPE_ALIGN (type) >= TREE_INT_CST_LOW (TYPE_SIZE (type))))
        {
          tree field;
          /* A union which has any BLKmode members must itself be BLKmode;
index de3655cb605ff35029ab7815e5b3b1c4559b1bcc..6cb386481b1853513f3c905a639763f2f401d596 100644 (file)
@@ -1266,7 +1266,7 @@ get_identifier (text)
 
   /* Decide how much of that length to hash on */
   hash_len = len;
-  if (warn_id_clash && len > id_clash_len)
+  if (warn_id_clash && (unsigned)len > id_clash_len)
     hash_len = id_clash_len;
 
   /* Compute hash code */
@@ -1285,7 +1285,7 @@ get_identifier (text)
       return idp;              /* <-- return if found */
 
   /* Not found; optionally warn about a similar identifier */
-  if (warn_id_clash && do_identifier_warnings && len >= id_clash_len)
+  if (warn_id_clash && do_identifier_warnings && (unsigned)len >= id_clash_len)
     for (idp = hash_table[hi]; idp; idp = TREE_CHAIN (idp))
       if (!strncmp (IDENTIFIER_POINTER (idp), text, id_clash_len))
        {
@@ -1329,7 +1329,7 @@ maybe_get_identifier (text)
 
   /* Decide how much of that length to hash on */
   hash_len = len;
-  if (warn_id_clash && len > id_clash_len)
+  if (warn_id_clash && (unsigned)len > id_clash_len)
     hash_len = id_clash_len;
 
   /* Compute hash code */
This page took 0.11814 seconds and 5 git commands to generate.