diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-10-14 09:02:55 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-10-14 09:02:55 +0000 |
commit | 274c11d805b29abde5083d1dced7b32ab761041f (patch) | |
tree | 512ed0c30b871532bb4d50fed36b99ceca838284 | |
parent | d77d05180c561683c54a2b9a17fd171e9e2be910 (diff) | |
download | gcc-274c11d805b29abde5083d1dced7b32ab761041f.tar.gz |
Warning fixes:
* Makefile.in (sched.o): Depend on recog.h.
* alias.c (REG_BASE_VALUE): Cast the result of REGNO() macro to
(unsigned) when comparing against one.
(find_base_value): Likewise.
(record_base_value): Cast variable `regno' to (unsigned) when
comparing against one. Cast the result of REGNO() macro to
(unsigned) when comparing against one.
(memrefs_conflict_p): Change type of variables `r_x' and `r_y' to
unsigned.
(init_alias_analysis): Add unsigned variable `ui'. Use it as loop
variable where an unsigned index is needed.
* caller-save.c (init_caller_save): Cast `-1' to (enum insn_code)
before comparing against one.
* collect2.c: Add prototypes for functions `error', `fatal' and
`fatal_perror'. Make these functions take variable arguments
instead of faking it with a fixed number of args.
(write_c_file_stat): Cast the argument of ctype macro to (unsigned
char).
* combine.c (can_combine_p): Mark parameter `pred' with
ATTRIBUTE_UNUSED.
(find_split_point): Cast variable `src' to (unsigned
HOST_WIDE_INT) when comparing against one.
HOST_WIDE_INT) when comparing against one.
(simplify_rtx): Cast 1 to (unsigned HOST_WIDE_INT) in shift.
(simplify_logical): Likewise.
(force_to_mode): Cast result of INTVAL() macro to (unsigned
HOST_WIDE_INT) when comparing against one. Cast 1 to (unsigned
HOST_WIDE_INT) in shift.
(simplify_and_const_int): Cast result of INTVAL() macro to
`unsigned HOST_WIDE_INT' when comparing against one.
(merge_outer_ops): Cast variable const0 to `unsigned
HOST_WIDE_INT' when comparing against the result of
GET_MODE_MASK() macro.
(simplify_comparison): Likewise for variable `c0'. Cast variable
`const_op' to `unsigned HOST_WIDE_INT' when comparing against
one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast the
result of `GET_MODE_MASK()/2' to `HOST_WIDE_INT' when comparing
against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast
result of INTVAL() macro to `unsigned HOST_WIDE_INT' when
comparing against one.
(distribute_notes): Wrap variable `cc0_setter' in macro `HAVE_cc0'.
config/mips/mips.c (gen_int_relational): Cast result of INTVAL()
macro to `unsigned HOST_WIDE_INT' when comparing against one.
(output_block_move): Cast `sizeof' expression to (int) when
comparing against one.
(function_arg): Cast BITS_PER_WORD to `unsigned' when comparing
against one.
(save_restore_insns): Cast `base_offset' to `long' to match format
specifier in fprintf.
* config/mips/mips.h (Pmode): Cast the result of `Pmode' macro
to `enum machine_mode'.
* flow.c (life_analysis_1): Remove unused variable `insn'.
* gcc.c (translate_options): Move variables `j' and `k' into the
scope in which they are used. Change their types to `size_t'.
(set_spec): Cast the argument of ctype macro to `unsigned char'.
(read_specs): Likewise.
(process_command): Cast `sizeof' to (int) when comparing against one.
(do_spec_1): Cast the argument of ctype macro to `unsigned char'.
(handle_braces): Cast both sides of `==' expression to `long' to
ensure sign matching.
(main): Cast variable `i' to `int' when comparing against one.
* gcov-io.h (__fetch_long): Change type of parameter `bytes' from
int to size_t. Cast variable `i' to size_t when comparing against
one.
* genattrtab.c (convert_set_attr_alternative): Remove unused
parameter `insn_code'. All callers changed.
(convert_set_attr): Likewise.
* genrecog.c (add_to_sequence): Cast result of XVECLEN() macro to
size_t when comparing against one. Likewise for variable `len'.
* global.c (global_alloc): Cast variable `max_regno' to size_t
when comparing against one. Likewise for variable `max_allocno'.
* jump.c (sets_cc0_p): Mark parameter `x' with ATTRIBUTE_UNUSED.
* local-alloc.c (validate_equiv_mem_from_store): Mark parameter
`set' with ATTRIBUTE_UNUSED.
(find_free_reg): Cast `sizeof' expression to (int) when comparing
against one.
* loop.c (count_loop_regs_set): Remove unused variable `dest'.
(strength_reduce): Mark parameter `bct_p' with ATTRIBUTE_UNUSED.
(get_condition): Cast variable `const_val' to `unsigned
HOST_WIDE_INT' when comparing against one. Cast unsigned
expression to HOST_WIDE_INT when comparing against one.
(insert_loop_mem): Mark parameter `data' with ATTRIBUTE_UNUSED.
(load_mems_and_recount_loop_regs_set): Cast variable `nregs' to
`unsigned' when comparing against one.
* protoize.c (is_id_char): Change type of parameter `ch' to
unsigned char.
(munge_compile_params): Cast argument of ctype macro to (const
unsigned char).
(process_aux_info_file): Cast variable `aux_info_size' to int when
comparing against one.
(forward_to_next_token_char): Cast argument of ctype macro to
`const unsigned char'.
(edit_formals_lists): Likewise.
(find_rightmost_formals_list): Likewise.
(add_local_decl): Likewise.
(add_global_decls): Likewise.
(edit_fn_definition): Likewise.
(do_cleaning): Likewise.
(scan_for_missed_items): Likewise.
(edit_file): Cast variable `orig_size' to (int) when comparing
against one.
(main): Cast argument of ctype macro to `const unsigned char'.
* recog.c (const_int_operand): Mark parameter `mode' with
ATTRIBUTE_UNUSED.
* regclass.c (record_reg_classes): Change type of variable `c' to
`unsigned char'. Cast `char' array index to `unsigned char'.
* reload.c (push_secondary_reload): Cast argument to
REG_CLASS_FROM_LETTER() macro to `unsigned char'.
* reload1.c (calculate_needs): Cast `char' array index to
`unsigned char'.
(set_label_offsets): Change type of variable `i' to unsigned int.
Cast result of XVECLEN() macro to unsigned when comparing against
one.
(mark_not_eliminable): Change type of variable `i' to unsigned.
(order_regs_for_reload): Likewise. Cast `max_regno' to unsigned
when comparing against one.
(reload_as_needed): Cast macro NUM_ELIMINABLE_REGS to (int) when
comparing against one.
(choose_reload_regs): Hide unused label `fail'.
(reload_cse_simplify_operands): Cast `char' array index to
`unsigned char'.
(reload_combine_note_store): Mark parameter `set' with
ATTRIBUTE_UNUSED. Cast UNITS_PER_WORD to unsigned when comparing
against one.
(reload_cse_move2add): Remove unused variable `src2'.
* sched.c: Include recog.h.
(sched_note_set): Remove unused parameter `b'. All callers
changed.
(split_hard_reg_notes): Likewise for parameter `orig_insn'.
(blockage_range): Cast result of UNIT_BLOCKED() macro to (int)
when comparing against one.
* stupid.c (stupid_find_reg): Mark parameter `changes_size' with
ATTRIBUTE_UNUSED. Cast `sizeof' expression to (int) when
comparing against one.
* unroll.c (precondition_loop_p): Remove unused parameter
`loop_end'. All callers changed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23079 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 161 | ||||
-rw-r--r-- | gcc/Makefile.in | 4 | ||||
-rw-r--r-- | gcc/alias.c | 33 | ||||
-rw-r--r-- | gcc/caller-save.c | 3 | ||||
-rw-r--r-- | gcc/collect2.c | 59 | ||||
-rw-r--r-- | gcc/combine.c | 34 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 15 | ||||
-rw-r--r-- | gcc/config/mips/mips.h | 2 | ||||
-rw-r--r-- | gcc/flow.c | 1 | ||||
-rw-r--r-- | gcc/gcc.c | 36 | ||||
-rw-r--r-- | gcc/gcov-io.h | 10 | ||||
-rw-r--r-- | gcc/genattrtab.c | 17 | ||||
-rw-r--r-- | gcc/genrecog.c | 6 | ||||
-rw-r--r-- | gcc/global.c | 16 | ||||
-rw-r--r-- | gcc/jump.c | 2 | ||||
-rw-r--r-- | gcc/local-alloc.c | 4 | ||||
-rw-r--r-- | gcc/loop.c | 11 | ||||
-rw-r--r-- | gcc/protoize.c | 63 | ||||
-rw-r--r-- | gcc/recog.c | 2 | ||||
-rw-r--r-- | gcc/regclass.c | 8 | ||||
-rw-r--r-- | gcc/reload.c | 4 | ||||
-rw-r--r-- | gcc/reload1.c | 27 | ||||
-rw-r--r-- | gcc/sched.c | 32 | ||||
-rw-r--r-- | gcc/stupid.c | 4 | ||||
-rw-r--r-- | gcc/unroll.c | 9 |
25 files changed, 390 insertions, 173 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9351a57c3e7..5ba13c741de 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,164 @@ +Wed Oct 14 11:14:02 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * Makefile.in (sched.o): Depend on recog.h. + + * alias.c (REG_BASE_VALUE): Cast the result of REGNO() macro to + (unsigned) when comparing against one. + (find_base_value): Likewise. + (record_base_value): Cast variable `regno' to (unsigned) when + comparing against one. Cast the result of REGNO() macro to + (unsigned) when comparing against one. + (memrefs_conflict_p): Change type of variables `r_x' and `r_y' to + unsigned. + (init_alias_analysis): Add unsigned variable `ui'. Use it as loop + variable where an unsigned index is needed. + + * caller-save.c (init_caller_save): Cast `-1' to (enum insn_code) + before comparing against one. + + * collect2.c: Add prototypes for functions `error', `fatal' and + `fatal_perror'. Make these functions take variable arguments + instead of faking it with a fixed number of args. + (write_c_file_stat): Cast the argument of ctype macro to (unsigned + char). + + * combine.c (can_combine_p): Mark parameter `pred' with + ATTRIBUTE_UNUSED. + (find_split_point): Cast variable `src' to (unsigned + HOST_WIDE_INT) when comparing against one. + (simplify_rtx): Cast 1 to (unsigned HOST_WIDE_INT) in shift. + (simplify_logical): Likewise. + (force_to_mode): Cast result of INTVAL() macro to (unsigned + HOST_WIDE_INT) when comparing against one. Cast 1 to (unsigned + HOST_WIDE_INT) in shift. + (simplify_and_const_int): Cast result of INTVAL() macro to + `unsigned HOST_WIDE_INT' when comparing against one. + (merge_outer_ops): Cast variable const0 to `unsigned + HOST_WIDE_INT' when comparing against the result of + GET_MODE_MASK() macro. + (simplify_comparison): Likewise for variable `c0'. Cast variable + `const_op' to `unsigned HOST_WIDE_INT' when comparing against + one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast the + result of `GET_MODE_MASK()/2' to `HOST_WIDE_INT' when comparing + against one. Cast `1' to `unsigned HOST_WIDE_INT' in shift. Cast + result of INTVAL() macro to `unsigned HOST_WIDE_INT' when + comparing against one. + (distribute_notes): Wrap variable `cc0_setter' in macro `HAVE_cc0'. + + config/mips/mips.c (gen_int_relational): Cast result of INTVAL() + macro to `unsigned HOST_WIDE_INT' when comparing against one. + (output_block_move): Cast `sizeof' expression to (int) when + comparing against one. + (function_arg): Cast BITS_PER_WORD to `unsigned' when comparing + against one. + (save_restore_insns): Cast `base_offset' to `long' to match format + specifier in fprintf. + + * config/mips/mips.h (Pmode): Cast the result of `Pmode' macro + to `enum machine_mode'. + + * flow.c (life_analysis_1): Remove unused variable `insn'. + + * gcc.c (translate_options): Move variables `j' and `k' into the + scope in which they are used. Change their types to `size_t'. + (set_spec): Cast the argument of ctype macro to `unsigned char'. + (read_specs): Likewise. + (process_command): Cast `sizeof' to (int) when comparing against one. + (do_spec_1): Cast the argument of ctype macro to `unsigned char'. + (handle_braces): Cast both sides of `==' expression to `long' to + ensure sign matching. + (main): Cast variable `i' to `int' when comparing against one. + + * gcov-io.h (__fetch_long): Change type of parameter `bytes' from + int to size_t. Cast variable `i' to size_t when comparing against + one. + + * genattrtab.c (convert_set_attr_alternative): Remove unused + parameter `insn_code'. All callers changed. + (convert_set_attr): Likewise. + + * genrecog.c (add_to_sequence): Cast result of XVECLEN() macro to + size_t when comparing against one. Likewise for variable `len'. + + * global.c (global_alloc): Cast variable `max_regno' to size_t + when comparing against one. Likewise for variable `max_allocno'. + + * jump.c (sets_cc0_p): Mark parameter `x' with ATTRIBUTE_UNUSED. + + * local-alloc.c (validate_equiv_mem_from_store): Mark parameter + `set' with ATTRIBUTE_UNUSED. + (find_free_reg): Cast `sizeof' expression to (int) when comparing + against one. + + * loop.c (count_loop_regs_set): Remove unused variable `dest'. + (strength_reduce): Mark parameter `bct_p' with ATTRIBUTE_UNUSED. + (get_condition): Cast variable `const_val' to `unsigned + HOST_WIDE_INT' when comparing against one. Cast unsigned + expression to HOST_WIDE_INT when comparing against one. + (insert_loop_mem): Mark parameter `data' with ATTRIBUTE_UNUSED. + (load_mems_and_recount_loop_regs_set): Cast variable `nregs' to + `unsigned' when comparing against one. + + * protoize.c (is_id_char): Change type of parameter `ch' to + unsigned char. + (munge_compile_params): Cast argument of ctype macro to (const + unsigned char). + (process_aux_info_file): Cast variable `aux_info_size' to int when + comparing against one. + (forward_to_next_token_char): Cast argument of ctype macro to + `const unsigned char'. + (edit_formals_lists): Likewise. + (find_rightmost_formals_list): Likewise. + (add_local_decl): Likewise. + (add_global_decls): Likewise. + (edit_fn_definition): Likewise. + (do_cleaning): Likewise. + (scan_for_missed_items): Likewise. + (edit_file): Cast variable `orig_size' to (int) when comparing + against one. + (main): Cast argument of ctype macro to `const unsigned char'. + + * recog.c (const_int_operand): Mark parameter `mode' with + ATTRIBUTE_UNUSED. + + * regclass.c (record_reg_classes): Change type of variable `c' to + `unsigned char'. Cast `char' array index to `unsigned char'. + + * reload.c (push_secondary_reload): Cast argument to + REG_CLASS_FROM_LETTER() macro to `unsigned char'. + + * reload1.c (calculate_needs): Cast `char' array index to + `unsigned char'. + (set_label_offsets): Change type of variable `i' to unsigned int. + Cast result of XVECLEN() macro to unsigned when comparing against + one. + (mark_not_eliminable): Change type of variable `i' to unsigned. + (order_regs_for_reload): Likewise. Cast `max_regno' to unsigned + when comparing against one. + (reload_as_needed): Cast macro NUM_ELIMINABLE_REGS to (int) when + comparing against one. + (choose_reload_regs): Hide unused label `fail'. + (reload_cse_simplify_operands): Cast `char' array index to + `unsigned char'. + (reload_combine_note_store): Mark parameter `set' with + ATTRIBUTE_UNUSED. Cast UNITS_PER_WORD to unsigned when comparing + against one. + (reload_cse_move2add): Remove unused variable `src2'. + + * sched.c: Include recog.h. + (sched_note_set): Remove unused parameter `b'. All callers + changed. + (split_hard_reg_notes): Likewise for parameter `orig_insn'. + (blockage_range): Cast result of UNIT_BLOCKED() macro to (int) + when comparing against one. + + * stupid.c (stupid_find_reg): Mark parameter `changes_size' with + ATTRIBUTE_UNUSED. Cast `sizeof' expression to (int) when + comparing against one. + + * unroll.c (precondition_loop_p): Remove unused parameter + `loop_end'. All callers changed. + Tue Oct 13 22:12:11 1998 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de> * reload1.c (maybe_fix_stack_asms): New static function. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 13f5818c9d4..e1b1413cdaf 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1511,8 +1511,8 @@ regmove.o : regmove.c $(CONFIG_H) system.h $(RTL_H) insn-config.h \ $(RECOG_H) output.h reload.h $(REGS_H) hard-reg-set.h flags.h \ $(EXPR_H) insn-flags.h $(BASIC_BLOCK_H) toplev.h $(SCHED_PREFIX)sched.o : $(SCHED_PREFIX)sched.c $(CONFIG_H) system.h $(RTL_H) \ - $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h insn-attr.h \ - toplev.h + $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h \ + insn-attr.h toplev.h recog.h final.o : final.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h $(REGS_H) \ $(RECOG_H) conditions.h insn-config.h insn-attr.h except.h real.h output.h \ hard-reg-set.h insn-flags.h insn-codes.h gstab.h xcoffout.h defaults.h \ diff --git a/gcc/alias.c b/gcc/alias.c index 4d696ddc47d..27a069f949e 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -94,7 +94,7 @@ rtx *reg_base_value; rtx *new_reg_base_value; unsigned int reg_base_value_size; /* size of reg_base_value array */ #define REG_BASE_VALUE(X) \ - (REGNO (X) < reg_base_value_size ? reg_base_value[REGNO (X)] : 0) + ((unsigned) REGNO (X) < reg_base_value_size ? reg_base_value[REGNO (X)] : 0) /* Vector of known invariant relationships between registers. Set in loop unrolling. Indexed by register number, if nonzero the value @@ -158,7 +158,7 @@ find_base_value (src) The test above is not sufficient because the scheduler may move a copy out of an arg reg past the NOTE_INSN_FUNCTION_BEGIN. */ if (REGNO (src) >= FIRST_PSEUDO_REGISTER - && REGNO (src) < reg_base_value_size + && (unsigned) REGNO (src) < reg_base_value_size && reg_base_value[REGNO (src)]) return reg_base_value[REGNO (src)]; @@ -341,7 +341,7 @@ record_base_value (regno, val, invariant) rtx val; int invariant; { - if (regno >= reg_base_value_size) + if ((unsigned) regno >= reg_base_value_size) return; /* If INVARIANT is true then this value also describes an invariant @@ -352,7 +352,7 @@ record_base_value (regno, val, invariant) if (GET_CODE (val) == REG) { - if (REGNO (val) < reg_base_value_size) + if ((unsigned) REGNO (val) < reg_base_value_size) { reg_base_value[regno] = reg_base_value[REGNO (val)]; } @@ -799,7 +799,7 @@ memrefs_conflict_p (xsize, x, ysize, y, c) /* Are these registers known not to be equal? */ if (alias_invariant) { - int r_x = REGNO (x), r_y = REGNO (y); + unsigned int r_x = REGNO (x), r_y = REGNO (y); rtx i_x, i_y; /* invariant relationships of X and Y */ i_x = r_x >= reg_base_value_size ? 0 : alias_invariant[r_x]; @@ -1071,6 +1071,7 @@ init_alias_analysis () int maxreg = max_reg_num (); int changed, pass; register int i; + register unsigned int ui; register rtx insn; reg_known_value_size = maxreg; @@ -1210,13 +1211,13 @@ init_alias_analysis () } /* Now propagate values from new_reg_base_value to reg_base_value. */ - for (i = 0; i < reg_base_value_size; i++) + for (ui = 0; ui < reg_base_value_size; ui++) { - if (new_reg_base_value[i] - && new_reg_base_value[i] != reg_base_value[i] - && ! rtx_equal_p (new_reg_base_value[i], reg_base_value[i])) + if (new_reg_base_value[ui] + && new_reg_base_value[ui] != reg_base_value[ui] + && ! rtx_equal_p (new_reg_base_value[ui], reg_base_value[ui])) { - reg_base_value[i] = new_reg_base_value[i]; + reg_base_value[ui] = new_reg_base_value[ui]; changed = 1; } } @@ -1243,16 +1244,16 @@ init_alias_analysis () { changed = 0; pass++; - for (i = 0; i < reg_base_value_size; i++) + for (ui = 0; ui < reg_base_value_size; ui++) { - rtx base = reg_base_value[i]; + rtx base = reg_base_value[ui]; if (base && GET_CODE (base) == REG) { - int base_regno = REGNO (base); - if (base_regno == i) /* register set from itself */ - reg_base_value[i] = 0; + unsigned int base_regno = REGNO (base); + if (base_regno == ui) /* register set from itself */ + reg_base_value[ui] = 0; else - reg_base_value[i] = reg_base_value[base_regno]; + reg_base_value[ui] = reg_base_value[base_regno]; changed = 1; } } diff --git a/gcc/caller-save.c b/gcc/caller-save.c index cbb19fba1a6..b05e8493a24 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -192,7 +192,8 @@ init_caller_save () /* Now extract both insns and see if we can meet their constraints. */ - ok = (reg_save_code[i][j] != -1 && reg_restore_code[i][j] != -1); + ok = (reg_save_code[i][j] != (enum insn_code)-1 + && reg_restore_code[i][j] != (enum insn_code)-1); if (ok) { insn_extract (saveinsn); diff --git a/gcc/collect2.c b/gcc/collect2.c index 86055b90017..bf494c04562 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -266,6 +266,11 @@ static struct path_prefix *libpaths[3] = {&cmdline_lib_dirs, static char *libexts[3] = {"a", "so", NULL}; /* possible library extentions */ #endif +void error PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1; +void fatal PVPROTO((const char *, ...)) + ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; +void fatal_perror PVPROTO((const char *, ...)) + ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; static char *my_strerror PROTO((int)); static const char *my_strsignal PROTO((int)); static void handler PROTO((int)); @@ -409,38 +414,72 @@ collect_exit (status) /* Die when sys call fails. */ void -fatal_perror (string, arg1, arg2, arg3) - char *string, *arg1, *arg2, *arg3; +fatal_perror VPROTO((const char * string, ...)) { +#ifndef __STDC__ + const char *string; +#endif int e = errno; + va_list ap; + + VA_START (ap, string); + +#ifndef __STDC__ + string = va_arg (ap, const char *); +#endif fprintf (stderr, "collect2: "); - fprintf (stderr, string, arg1, arg2, arg3); + vfprintf (stderr, string, ap); fprintf (stderr, ": %s\n", my_strerror (e)); + va_end (ap); + collect_exit (FATAL_EXIT_CODE); } /* Just die. */ void -fatal (string, arg1, arg2, arg3) - char *string, *arg1, *arg2, *arg3; +fatal VPROTO((const char * string, ...)) { +#ifndef __STDC__ + const char *string; +#endif + va_list ap; + + VA_START (ap, string); + +#ifndef __STDC__ + string = va_arg (ap, const char *); +#endif + fprintf (stderr, "collect2: "); - fprintf (stderr, string, arg1, arg2, arg3); + vfprintf (stderr, string, ap); fprintf (stderr, "\n"); + va_end (ap); + collect_exit (FATAL_EXIT_CODE); } /* Write error message. */ void -error (string, arg1, arg2, arg3, arg4) - char *string, *arg1, *arg2, *arg3, *arg4; +error VPROTO((const char * string, ...)) { +#ifndef __STDC__ + const char * string; +#endif + va_list ap; + + VA_START (ap, string); + +#ifndef __STDC__ + string = va_arg (ap, const char *); +#endif + fprintf (stderr, "collect2: "); - fprintf (stderr, string, arg1, arg2, arg3, arg4); + vfprintf (stderr, string, ap); fprintf (stderr, "\n"); + va_end(ap); } /* In case obstack is linked in, and abort is defined to fancy_abort, @@ -1940,7 +1979,7 @@ write_c_file_stat (stream, name) strncpy (prefix, p, q - p); prefix[q - p] = 0; for (q = prefix; *q; q++) - if (!ISALNUM (*q)) + if (!ISALNUM ((unsigned char)*q)) *q = '_'; if (debug) fprintf (stderr, "\nwrite_c_file - output name is %s, prefix is %s\n", diff --git a/gcc/combine.c b/gcc/combine.c index 420a60fca5f..619c897f811 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -816,7 +816,8 @@ static int can_combine_p (insn, i3, pred, succ, pdest, psrc) rtx insn; rtx i3; - rtx pred, succ; + rtx pred ATTRIBUTE_UNUSED; + rtx succ; rtx *pdest, *psrc; { int i; @@ -2750,7 +2751,7 @@ find_split_point (loc, insn) if (BITS_BIG_ENDIAN) pos = GET_MODE_BITSIZE (mode) - len - pos; - if (src == mask) + if ((unsigned HOST_WIDE_INT) src == mask) SUBST (SET_SRC (x), gen_binary (IOR, mode, dest, GEN_INT (src << pos))); else @@ -4119,7 +4120,7 @@ simplify_rtx (x, op0_mode, last, in_dest) if (new_code == NE && GET_MODE_CLASS (mode) == MODE_INT && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT && ((STORE_FLAG_VALUE & GET_MODE_MASK (mode)) - == (HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (mode) - 1)) + == (unsigned HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE(mode)-1)) && op1 == const0_rtx && mode == GET_MODE (op0) && (i = exact_log2 (nonzero_bits (op0, mode))) >= 0) @@ -5086,7 +5087,7 @@ simplify_logical (x, last) when STORE_FLAG_VALUE is the sign bit. */ if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT && ((STORE_FLAG_VALUE & GET_MODE_MASK (mode)) - == (HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (mode) - 1)) + == (unsigned HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (mode) - 1)) && op1 == const_true_rtx && GET_RTX_CLASS (GET_CODE (op0)) == '<' && reversible_comparison_p (op0)) @@ -6319,7 +6320,7 @@ force_to_mode (x, mode, mask, reg, just_select) need it. */ if (GET_CODE (x) == AND && GET_CODE (XEXP (x, 1)) == CONST_INT - && INTVAL (XEXP (x, 1)) == mask) + && (unsigned HOST_WIDE_INT) INTVAL (XEXP (x, 1)) == mask) x = XEXP (x, 0); /* If it remains an AND, try making another AND with the bits @@ -6540,7 +6541,7 @@ force_to_mode (x, mode, mask, reg, just_select) /* If we are just looking for the sign bit, we don't need this shift at all, even if it has a variable count. */ if (GET_MODE_BITSIZE (GET_MODE (x)) <= HOST_BITS_PER_WIDE_INT - && (mask == ((HOST_WIDE_INT) 1 + && (mask == ((unsigned HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (GET_MODE (x)) - 1)))) return force_to_mode (XEXP (x, 0), mode, mask, reg, next_select); @@ -7367,7 +7368,7 @@ simplify_and_const_int (x, mode, varop, constop) else { if (GET_CODE (XEXP (x, 1)) != CONST_INT - || INTVAL (XEXP (x, 1)) != constop) + || (unsigned HOST_WIDE_INT) INTVAL (XEXP (x, 1)) != constop) SUBST (XEXP (x, 1), GEN_INT (constop)); SUBST (XEXP (x, 0), varop); @@ -8273,7 +8274,8 @@ merge_outer_ops (pop0, pconst0, op1, const1, mode, pcomp_p) op0 = NIL; else if (const0 == 0 && op0 == AND) op0 = SET; - else if (const0 == GET_MODE_MASK (mode) && op0 == AND) + else if ((unsigned HOST_WIDE_INT) const0 == GET_MODE_MASK (mode) + && op0 == AND) op0 = NIL; /* If this would be an entire word for the target, but is not for @@ -9534,7 +9536,7 @@ simplify_comparison (code, pop0, pop1) for (tmode = GET_CLASS_NARROWEST_MODE (GET_MODE_CLASS (GET_MODE (op0))); tmode != GET_MODE (op0); tmode = GET_MODE_WIDER_MODE (tmode)) - if (c0 == GET_MODE_MASK (tmode)) + if ((unsigned HOST_WIDE_INT) c0 == GET_MODE_MASK (tmode)) { op0 = gen_lowpart_for_combine (tmode, inner_op0); op1 = gen_lowpart_for_combine (tmode, inner_op1); @@ -9609,7 +9611,7 @@ simplify_comparison (code, pop0, pop1) || code == LT || code == LTU) && mode_width <= HOST_BITS_PER_WIDE_INT && exact_log2 (const_op) >= 0 - && nonzero_bits (op0, mode) == const_op) + && nonzero_bits (op0, mode) == (unsigned HOST_WIDE_INT) const_op) { code = (code == EQ || code == GE || code == GEU ? NE : EQ); op1 = const0_rtx, const_op = 0; @@ -9938,7 +9940,7 @@ simplify_comparison (code, pop0, pop1) && (GET_MODE_BITSIZE (GET_MODE (XEXP (op0, 0))) <= HOST_BITS_PER_WIDE_INT) && ((unsigned HOST_WIDE_INT) const_op - < (((HOST_WIDE_INT) 1 + < (((unsigned HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (GET_MODE (XEXP (op0, 0))) - 1))))) { op0 = XEXP (op0, 0); @@ -9962,7 +9964,7 @@ simplify_comparison (code, pop0, pop1) && GET_CODE (XEXP (SUBREG_REG (op0), 1)) == CONST_INT && INTVAL (XEXP (SUBREG_REG (op0), 1)) < 0 && (- INTVAL (XEXP (SUBREG_REG (op0), 1)) - < GET_MODE_MASK (mode) / 2) + < (HOST_WIDE_INT)(GET_MODE_MASK (mode) / 2)) && (unsigned HOST_WIDE_INT) const_op < GET_MODE_MASK (mode) / 2 && (0 == (nonzero_bits (XEXP (SUBREG_REG (op0), 0), GET_MODE (SUBREG_REG (op0))) @@ -10166,7 +10168,7 @@ simplify_comparison (code, pop0, pop1) && GET_CODE (XEXP (op0, 1)) == CONST_INT && mode_width <= HOST_BITS_PER_WIDE_INT && ((INTVAL (XEXP (op0, 1)) & GET_MODE_MASK (mode)) - == (HOST_WIDE_INT) 1 << (mode_width - 1))) + == (unsigned HOST_WIDE_INT) 1 << (mode_width - 1))) { op0 = XEXP (op0, 0); code = (code == EQ ? GE : LT); @@ -10217,8 +10219,8 @@ simplify_comparison (code, pop0, pop1) && (INTVAL (XEXP (op0, 1)) & ~ mask) == 0 && 0 == (~ GET_MODE_MASK (GET_MODE (SUBREG_REG (XEXP (op0, 0)))) & INTVAL (XEXP (op0, 1))) - && INTVAL (XEXP (op0, 1)) != mask - && (INTVAL (XEXP (op0, 1)) + && (unsigned HOST_WIDE_INT) INTVAL (XEXP (op0, 1)) != mask + && ((unsigned HOST_WIDE_INT) INTVAL (XEXP (op0, 1)) != GET_MODE_MASK (GET_MODE (SUBREG_REG (XEXP (op0, 0)))))) { @@ -11563,7 +11565,9 @@ distribute_notes (notes, from_insn, i3, i2, elim_i2, elim_i1) { rtx set = single_set (tem); rtx inner_dest = 0; +#ifdef HAVE_cc0 rtx cc0_setter = NULL_RTX; +#endif if (set != 0) for (inner_dest = SET_DEST (set); diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 98c634dc34a..d795059ebae 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -2682,7 +2682,7 @@ gen_int_relational (test_code, result, cmp0, cmp1, p_invert) && p_info->const_add != 0 && ((p_info->unsignedp ? ((unsigned HOST_WIDE_INT) (value + p_info->const_add) - > INTVAL (cmp1)) + > (unsigned HOST_WIDE_INT) INTVAL (cmp1)) : (value + p_info->const_add) > INTVAL (cmp1)) != (p_info->const_add > 0)))) cmp1 = force_reg (mode, cmp1); @@ -2710,7 +2710,8 @@ gen_int_relational (test_code, result, cmp0, cmp1, p_invert) we would get the wrong answer if we follow the usual path; thus, x > 0xffffffffU would turn into x > 0U. */ if ((p_info->unsignedp - ? (unsigned HOST_WIDE_INT) new > INTVAL (cmp1) + ? (unsigned HOST_WIDE_INT) new > + (unsigned HOST_WIDE_INT) INTVAL (cmp1) : new > INTVAL (cmp1)) != (p_info->const_add > 0)) { @@ -3230,7 +3231,7 @@ output_block_move (insn, operands, num_regs, move_type) the number of registers available. */ for (i = 4; i < last_operand - && safe_regs < (sizeof(xoperands) / sizeof(xoperands[0])); + && safe_regs < (int)(sizeof(xoperands) / sizeof(xoperands[0])); i++) if (! reg_mentioned_p (operands[i], operands[0]) && ! reg_mentioned_p (operands[i], operands[1])) @@ -3326,7 +3327,7 @@ output_block_move (insn, operands, num_regs, move_type) } } - if (num_regs > sizeof (load_store) / sizeof (load_store[0])) + if (num_regs > (int)(sizeof (load_store) / sizeof (load_store[0]))) num_regs = sizeof (load_store) / sizeof (load_store[0]); else if (num_regs < 1) @@ -3749,7 +3750,7 @@ function_arg (cum, mode, type, named) /* Drops through. */ case BLKmode: - if (type != (tree)0 && TYPE_ALIGN (type) > BITS_PER_WORD + if (type != (tree)0 && TYPE_ALIGN (type) > (unsigned) BITS_PER_WORD && ! TARGET_64BIT && mips_abi != ABI_EABI) cum->arg_words += (cum->arg_words & 1); regbase = GP_ARG_FIRST; @@ -5764,7 +5765,7 @@ save_restore_insns (store_p, large_reg, large_offset, file) else { fprintf (file, "\tli\t%s,0x%.08lx\t# ", - reg_names[MIPS_TEMP2_REGNUM], base_offset); + reg_names[MIPS_TEMP2_REGNUM], (long) base_offset); fprintf (file, HOST_WIDE_INT_PRINT_DEC, base_offset); fprintf (file, "\n\t%s\t%s,%s,%s\n", Pmode == DImode ? "daddu" : "addu", @@ -5981,7 +5982,7 @@ save_restore_insns (store_p, large_reg, large_offset, file) else { fprintf (file, "\tli\t%s,0x%.08lx\t# ", - reg_names[MIPS_TEMP2_REGNUM], base_offset); + reg_names[MIPS_TEMP2_REGNUM], (long) base_offset); fprintf (file, HOST_WIDE_INT_PRINT_DEC, base_offset); fprintf (file, "\n\t%s\t%s,%s,%s\n", Pmode == DImode ? "daddu" : "addu", diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index ddbc3bd628c..c562307310f 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -3183,7 +3183,7 @@ while (0) between pointers and any other objects of this machine mode. */ #ifndef Pmode -#define Pmode (TARGET_LONG64 ? DImode : SImode) +#define Pmode ((enum machine_mode)(TARGET_LONG64 ? DImode : SImode)) #endif /* A function address in a call instruction diff --git a/gcc/flow.c b/gcc/flow.c index 6d3bbd8dce7..a7865730d98 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -1347,7 +1347,6 @@ life_analysis_1 (f, nregs) possibly excluding those that are used after they are set. */ regset *basic_block_significant; register int i; - rtx insn; struct obstack flow_obstack; diff --git a/gcc/gcc.c b/gcc/gcc.c index 3dc6518256d..b9740129884 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -930,7 +930,7 @@ translate_options (argcp, argvp) int *argcp; char ***argvp; { - int i, j, k; + int i; int argc = *argcp; char **argv = *argvp; char **newv = (char **) xmalloc ((argc + 2) * 2 * sizeof (char *)); @@ -944,6 +944,7 @@ translate_options (argcp, argvp) /* Translate -- options. */ if (argv[i][0] == '-' && argv[i][1] == '-') { + size_t j; /* Find a mapping that applies to this option. */ for (j = 0; j < sizeof (option_map) / sizeof (option_map[0]); j++) { @@ -961,6 +962,7 @@ translate_options (argcp, argvp) if (arglen < optlen) { + size_t k; for (k = j + 1; k < sizeof (option_map) / sizeof (option_map[0]); k++) @@ -1267,7 +1269,7 @@ set_spec (name, spec) } old_spec = *(sl->ptr_spec); - *(sl->ptr_spec) = ((spec[0] == '+' && ISSPACE (spec[1])) + *(sl->ptr_spec) = ((spec[0] == '+' && ISSPACE ((unsigned char)spec[1])) ? concat (old_spec, spec + 1, NULL_PTR) : save_string (spec, strlen (spec))); @@ -1566,12 +1568,12 @@ read_specs (filename, main_p) while (*p1 == ' ' || *p1 == '\t') p1++; - if (! ISALPHA (*p1)) + if (! ISALPHA ((unsigned char)*p1)) fatal ("specs %%rename syntax malformed after %d characters", p1 - buffer); p2 = p1; - while (*p2 && !ISSPACE (*p2)) + while (*p2 && !ISSPACE ((unsigned char)*p2)) p2++; if (*p2 != ' ' && *p2 != '\t') @@ -1583,13 +1585,13 @@ read_specs (filename, main_p) while (*p2 == ' ' || *p2 == '\t') p2++; - if (! ISALPHA (*p2)) + if (! ISALPHA ((unsigned char)*p2)) fatal ("specs %%rename syntax malformed after %d characters", p2 - buffer); /* Get new spec name */ p3 = p2; - while (*p3 && !ISSPACE (*p3)) + while (*p3 && !ISSPACE ((unsigned char)*p3)) p3++; if (p3 != p-1) @@ -2606,7 +2608,7 @@ process_command (argc, argv) if (gcc_exec_prefix) { int len = strlen (gcc_exec_prefix); - if (len > sizeof ("/lib/gcc-lib/")-1 + if (len > (int) sizeof ("/lib/gcc-lib/")-1 && (gcc_exec_prefix[len-1] == '/' || gcc_exec_prefix[len-1] == DIR_SEPARATOR)) { @@ -3664,7 +3666,7 @@ do_spec_1 (spec, inswitch, soft_matched_part) if (p[0] == '%' && p[1] == 'O') { /* We don't support extra suffix characters after %O. */ - if (*p == '.' || ISALPHA (*p)) + if (*p == '.' || ISALPHA ((unsigned char)*p)) abort (); suffix = OBJECT_SUFFIX; suffix_length = strlen (OBJECT_SUFFIX); @@ -3672,7 +3674,7 @@ do_spec_1 (spec, inswitch, soft_matched_part) } else { - while (*p == '.' || ISALPHA (*p)) + while (*p == '.' || ISALPHA ((unsigned char)*p)) p++; suffix_length = p - suffix; } @@ -3960,7 +3962,8 @@ do_spec_1 (spec, inswitch, soft_matched_part) *x++ = *y++; if (*y != '_' - || (*(y+1) != '_' && ! ISUPPER (*(y+1)))) + || (*(y+1) != '_' + && ! ISUPPER ((unsigned char)*(y+1)))) { /* Stick __ at front of macro name. */ *x++ = '_'; @@ -4002,7 +4005,8 @@ do_spec_1 (spec, inswitch, soft_matched_part) y += 2; if (*y != '_' - || (*(y+1) != '_' && ! ISUPPER (*(y+1)))) + || (*(y+1) != '_' + && ! ISUPPER ((unsigned char)*(y+1)))) { /* Stick -D__ at front of macro name. */ *x++ = '-'; @@ -4304,7 +4308,7 @@ next_member: if (suffix) { int found = (input_suffix != 0 - && strlen (input_suffix) == p - filter + && (long) strlen (input_suffix) == (long)(p - filter) && strncmp (input_suffix, filter, p - filter) == 0); if (body[0] == '}') @@ -4748,7 +4752,7 @@ main (argc, argv) sizeof ("COLLECT_GCC_OPTIONS=")-1); first_time = TRUE; - for (i = 0; i < n_switches; i++) + for (i = 0; (int)i < n_switches; i++) { char **args; char *p, *q; @@ -4919,7 +4923,7 @@ main (argc, argv) /* Warn about any switches that no pass was interested in. */ - for (i = 0; i < n_switches; i++) + for (i = 0; (int)i < n_switches; i++) if (! switches[i].valid) error ("unrecognized option `-%s'", switches[i].part1); @@ -5018,7 +5022,7 @@ main (argc, argv) explicit_link_files = xmalloc (n_infiles); bzero (explicit_link_files, n_infiles); - for (i = 0; i < n_infiles; i++) + for (i = 0; (int)i < n_infiles; i++) { register struct compiler *cp = 0; int this_file_error = 0; @@ -5149,7 +5153,7 @@ main (argc, argv) complain about input files to be given to the linker. */ if (! linker_was_run && error_count == 0) - for (i = 0; i < n_infiles; i++) + for (i = 0; (int)i < n_infiles; i++) if (explicit_link_files[i]) error ("%s: linker input file unused since linking not done", outfiles[i]); diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h index c2949a311af..67b194b0c75 100644 --- a/gcc/gcov-io.h +++ b/gcc/gcov-io.h @@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */ #include <stdio.h> #include <sys/types.h> -static int __fetch_long PROTO ((long *, char *, int)); +static int __fetch_long PROTO ((long *, char *, size_t)); static int __store_long PROTO ((long, char *, size_t)); static int __read_long PROTO ((long *, FILE *, size_t)); static int __write_long PROTO ((long, FILE *, size_t)); @@ -74,17 +74,17 @@ static int __fetch_long (dest, source, bytes) long *dest; char *source; - int bytes; + size_t bytes; { long value = 0; int i; - for (i = bytes - 1; i > (sizeof (*dest) - 1); i--) - if (source[i] & (i == (bytes - 1) ? 127 : 255 )) + for (i = bytes - 1; (size_t) i > (sizeof (*dest) - 1); i--) + if (source[i] & ((size_t) i == (bytes - 1) ? 127 : 255 )) return 1; for (; i >= 0; i--) - value = value * 256 + (source[i] & (i == (bytes - 1) ? 127 : 255)); + value = value * 256 + (source[i] & ((size_t)i == (bytes - 1) ? 127 : 255)); if ((source[bytes - 1] & 128) && (value > 0)) value = - value; diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index cb75eaa1e62..40bb38ba03c 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -368,8 +368,8 @@ static char *attr_printf PVPROTO((int, char *, ...)); static char *attr_string PROTO((char *, int)); static rtx check_attr_test PROTO((rtx, int)); static rtx check_attr_value PROTO((rtx, struct attr_desc *)); -static rtx convert_set_attr_alternative PROTO((rtx, int, int, int)); -static rtx convert_set_attr PROTO((rtx, int, int, int)); +static rtx convert_set_attr_alternative PROTO((rtx, int, int)); +static rtx convert_set_attr PROTO((rtx, int, int)); static void check_defs PROTO((void)); #if 0 static rtx convert_const_symbol_ref PROTO((rtx, struct attr_desc *)); @@ -1166,10 +1166,10 @@ check_attr_value (exp, attr) It becomes a COND with each test being (eq_attr "alternative "n") */ static rtx -convert_set_attr_alternative (exp, num_alt, insn_code, insn_index) +convert_set_attr_alternative (exp, num_alt, insn_index) rtx exp; int num_alt; - int insn_code, insn_index; + int insn_index; { rtx condexp; int i; @@ -1207,10 +1207,10 @@ convert_set_attr_alternative (exp, num_alt, insn_code, insn_index) list of values is given, convert to SET_ATTR_ALTERNATIVE first. */ static rtx -convert_set_attr (exp, num_alt, insn_code, insn_index) +convert_set_attr (exp, num_alt, insn_index) rtx exp; int num_alt; - int insn_code, insn_index; + int insn_index; { rtx newexp; char *name_ptr; @@ -1234,7 +1234,7 @@ convert_set_attr (exp, num_alt, insn_code, insn_index) while ((p = next_comma_elt (&name_ptr)) != NULL) XVECEXP (newexp, 1, n++) = attr_rtx (CONST_STRING, p); - return convert_set_attr_alternative (newexp, num_alt, insn_code, insn_index); + return convert_set_attr_alternative (newexp, num_alt, insn_index); } /* Scan all definitions, checking for validity. Also, convert any SET_ATTR @@ -1267,13 +1267,12 @@ check_defs () case SET_ATTR_ALTERNATIVE: value = convert_set_attr_alternative (value, id->num_alternatives, - id->insn_code, id->insn_index); break; case SET_ATTR: value = convert_set_attr (value, id->num_alternatives, - id->insn_code, id->insn_index); + id->insn_index); break; default: diff --git a/gcc/genrecog.c b/gcc/genrecog.c index cffa47fd7b9..6ea513c6547 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -416,7 +416,7 @@ add_to_sequence (pattern, last, position) if (code == MATCH_OPERATOR || code == MATCH_PARALLEL) { - for (i = 0; i < XVECLEN (pattern, 2); i++) + for (i = 0; i < (size_t) XVECLEN (pattern, 2); i++) { newpos[depth] = i + (code == MATCH_OPERATOR ? '0': 'a'); new = add_to_sequence (XVECEXP (pattern, 2, i), @@ -431,7 +431,7 @@ add_to_sequence (pattern, last, position) new->dupno = XINT (pattern, 0); new->code = UNKNOWN; new->tests = 0; - for (i = 0; i < XVECLEN (pattern, 1); i++) + for (i = 0; i < (size_t) XVECLEN (pattern, 1); i++) { newpos[depth] = i + '0'; new = add_to_sequence (XVECEXP (pattern, 1, i), @@ -528,7 +528,7 @@ add_to_sequence (pattern, last, position) fmt = GET_RTX_FORMAT (code); len = GET_RTX_LENGTH (code); - for (i = 0; i < len; i++) + for (i = 0; i < (size_t) len; i++) { newpos[depth] = '0' + i; if (fmt[i] == 'e' || fmt[i] == 'u') diff --git a/gcc/global.c b/gcc/global.c index af27ea0dc84..3dd8463bc41 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -363,7 +363,7 @@ global_alloc (file) SET_HARD_REG_BIT (regs_used_so_far, i); #endif - for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++) + for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++) if (reg_renumber[i] >= 0) SET_HARD_REG_BIT (regs_used_so_far, reg_renumber[i]); @@ -389,7 +389,7 @@ global_alloc (file) reg_may_share[r2] = r1; } - for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++) + for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++) /* Note that reg_live_length[i] < 0 indicates a "constant" reg that we are supposed to refrain from putting in a hard reg. -2 means do make an allocno but don't allocate it. */ @@ -419,7 +419,7 @@ global_alloc (file) bzero ((char *) allocno_n_refs, max_allocno * sizeof (int)); bzero ((char *) allocno_live_length, max_allocno * sizeof (int)); - for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++) + for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++) if (reg_allocno[i] >= 0) { int allocno = reg_allocno[i]; @@ -436,7 +436,7 @@ global_alloc (file) override it. */ bzero ((char *) local_reg_live_length, sizeof local_reg_live_length); bzero ((char *) local_reg_n_refs, sizeof local_reg_n_refs); - for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++) + for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++) if (reg_renumber[i] >= 0) { int regno = reg_renumber[i]; @@ -509,7 +509,7 @@ global_alloc (file) So in either case, we can ignore the conflict. Likewise for preferences. */ - for (i = 0; i < max_allocno; i++) + for (i = 0; i < (size_t) max_allocno; i++) { AND_COMPL_HARD_REG_SET (hard_reg_conflicts[i], eliminable_regset); AND_COMPL_HARD_REG_SET (hard_reg_copy_preferences[i], @@ -524,7 +524,7 @@ global_alloc (file) /* Determine the order to allocate the remaining pseudo registers. */ allocno_order = (int *) alloca (max_allocno * sizeof (int)); - for (i = 0; i < max_allocno; i++) + for (i = 0; i < (size_t) max_allocno; i++) allocno_order[i] = i; /* Default the size to 1, since allocno_compare uses it to divide by. @@ -534,7 +534,7 @@ global_alloc (file) allocate it. So avoid the divide-by-zero and set it to a low priority. */ - for (i = 0; i < max_allocno; i++) + for (i = 0; i < (size_t) max_allocno; i++) { if (allocno_size[i] == 0) allocno_size[i] = 1; @@ -552,7 +552,7 @@ global_alloc (file) /* Try allocating them, one by one, in that order, except for parameters marked with reg_live_length[regno] == -2. */ - for (i = 0; i < max_allocno; i++) + for (i = 0; i < (size_t) max_allocno; i++) if (reg_renumber[allocno_reg[allocno_order[i]]] < 0 && REG_LIVE_LENGTH (allocno_reg[allocno_order[i]]) >= 0) { diff --git a/gcc/jump.c b/gcc/jump.c index 16928a94e6f..8ae0b0aed89 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -3328,7 +3328,7 @@ condjump_in_parallel_p (insn) int sets_cc0_p (x) - rtx x; + rtx x ATTRIBUTE_UNUSED; { #ifdef HAVE_cc0 if (GET_CODE (x) == SET && SET_DEST (x) == cc0_rtx) diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 462755fda42..1e6955ac6ca 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -420,7 +420,7 @@ static int equiv_mem_modified; static void validate_equiv_mem_from_store (dest, set) rtx dest; - rtx set; + rtx set ATTRIBUTE_UNUSED; { if ((GET_CODE (dest) == REG && reg_overlap_mentioned_p (dest, equiv_mem)) @@ -1858,7 +1858,7 @@ find_free_reg (class, mode, qty, accept_call_clobbered, just_try_suggested, This is true of any register that can be eliminated. */ #ifdef ELIMINABLE_REGS - for (i = 0; i < sizeof eliminables / sizeof eliminables[0]; i++) + for (i = 0; i < (int)(sizeof eliminables / sizeof eliminables[0]); i++) SET_HARD_REG_BIT (used, eliminables[i].from); #if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM /* If FRAME_POINTER_REGNUM is not a real register, then protect the one diff --git a/gcc/loop.c b/gcc/loop.c index aa398eb8573..792992026dd 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -3387,7 +3387,6 @@ count_loop_regs_set (from, to, may_not_move, single_usage, count_ptr, nregs) register rtx *last_set = (rtx *) alloca (nregs * sizeof (rtx)); register rtx insn; register int count = 0; - register rtx dest; bzero ((char *) last_set, nregs * sizeof (rtx)); for (insn = from; insn != to; insn = NEXT_INSN (insn)) @@ -3544,7 +3543,7 @@ strength_reduce (scan_start, end, loop_top, insn_count, int insn_count; rtx loop_start; rtx loop_end; - int unroll_p, bct_p; + int unroll_p, bct_p ATTRIBUTE_UNUSED; { rtx p; rtx set; @@ -7871,14 +7870,14 @@ get_condition (jump, earliest) switch (code) { case LE: - if (const_val != max_val >> 1) + if ((unsigned HOST_WIDE_INT) const_val != max_val >> 1) code = LT, op1 = GEN_INT (const_val + 1); break; /* When cross-compiling, const_val might be sign-extended from BITS_PER_WORD to HOST_BITS_PER_WIDE_INT */ case GE: - if ((const_val & max_val) + if ((HOST_WIDE_INT) (const_val & max_val) != (((HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (GET_MODE (op0)) - 1)))) code = GT, op1 = GEN_INT (const_val - 1); @@ -8249,7 +8248,7 @@ indirect_jump_in_function_p (start) static int insert_loop_mem (mem, data) rtx *mem; - void *data; + void *data ATTRIBUTE_UNUSED; { int i; rtx m = *mem; @@ -8339,7 +8338,7 @@ load_mems_and_recount_loop_regs_set (scan_start, end, loop_top, start, old_nregs = nregs; nregs = max_reg_num (); - if (nregs > n_times_set->num_elements) + if ((unsigned) nregs > n_times_set->num_elements) { /* Grow all the arrays. */ VARRAY_GROW (n_times_set, nregs); diff --git a/gcc/protoize.c b/gcc/protoize.c index a7a5ae92e2b..73d8caba390 100644 --- a/gcc/protoize.c +++ b/gcc/protoize.c @@ -824,7 +824,7 @@ restore_pointers () static int is_id_char (ch) - char ch; + unsigned char ch; { return (ISALNUM (ch) || (ch == '_') || (ch == '$')); } @@ -2002,12 +2002,12 @@ munge_compile_params (params_list) temp_params[param_count++] = compiler_file_name; for (;;) { - while (ISSPACE (*params_list)) + while (ISSPACE ((const unsigned char)*params_list)) params_list++; if (!*params_list) break; param = params_list; - while (*params_list && !ISSPACE (*params_list)) + while (*params_list && !ISSPACE ((const unsigned char)*params_list)) params_list++; if (param[0] != '-') temp_params[param_count++] @@ -2022,9 +2022,10 @@ munge_compile_params (params_list) case 'c': break; /* Don't copy these. */ case 'o': - while (ISSPACE (*params_list)) + while (ISSPACE ((const unsigned char)*params_list)) params_list++; - while (*params_list && !ISSPACE (*params_list)) + while (*params_list + && !ISSPACE ((const unsigned char)*params_list)) params_list++; break; default: @@ -2287,7 +2288,8 @@ start_over: ; /* Read the aux_info file into memory. */ - if (safe_read (aux_info_file, aux_info_base, aux_info_size) != aux_info_size) + if (safe_read (aux_info_file, aux_info_base, aux_info_size) != + (int) aux_info_size) { int errno_val = errno; fprintf (stderr, "%s: error reading aux info file `%s': %s\n", @@ -2955,7 +2957,8 @@ static const char * forward_to_next_token_char (ptr) const char *ptr; { - for (++ptr; ISSPACE (*ptr); check_source (++ptr < clean_text_limit, 0)) + for (++ptr; ISSPACE ((const unsigned char)*ptr); + check_source (++ptr < clean_text_limit, 0)) continue; return ptr; } @@ -3323,7 +3326,7 @@ edit_formals_lists (end_formals, f_list_count, def_dec_p) next_end = start_formals - 1; check_source (next_end > clean_read_ptr, 0); - while (ISSPACE (*next_end)) + while (ISSPACE ((const unsigned char)*next_end)) check_source (--next_end > clean_read_ptr, 0); check_source (*next_end == ')', next_end); check_source (--next_end > clean_read_ptr, 0); @@ -3343,7 +3346,8 @@ edit_formals_lists (end_formals, f_list_count, def_dec_p) const char *func_name_limit; size_t func_name_len; - for (func_name_limit = start_formals-1; ISSPACE (*func_name_limit); ) + for (func_name_limit = start_formals-1; + ISSPACE ((const unsigned char)*func_name_limit); ) check_source (--func_name_limit > clean_read_ptr, 0); for (func_name_start = func_name_limit++; @@ -3469,8 +3473,8 @@ find_rightmost_formals_list (clean_text_p) while (*end_formals != ')') { - if (ISSPACE (*end_formals)) - while (ISSPACE (*end_formals)) + if (ISSPACE ((const unsigned char)*end_formals)) + while (ISSPACE ((const unsigned char)*end_formals)) check_source (--end_formals > clean_read_ptr, 0); else check_source (--end_formals > clean_read_ptr, 0); @@ -3488,7 +3492,7 @@ find_rightmost_formals_list (clean_text_p) by an alphabetic character, while others *cannot* validly be followed by such characters. */ - if ((ch == '{') || ISALPHA (ch)) + if ((ch == '{') || ISALPHA ((unsigned char)ch)) break; /* At this point, we have found a right paren, but we know that it is @@ -3584,7 +3588,7 @@ add_local_decl (def_dec_p, clean_text_p) We can now just scan backwards and find the left end of the existing indentation string, and then copy it to the output buffer. */ - for (sp = ep; ISSPACE (*sp) && *sp != '\n'; sp--) + for (sp = ep; ISSPACE ((const unsigned char)*sp) && *sp != '\n'; sp--) continue; /* Now write out the open { which began this block, and any following @@ -3665,7 +3669,7 @@ add_global_decls (file_p, clean_text_p) header. We will put in the added declarations just prior to that. */ scan_p++; - while (ISSPACE (*scan_p)) + while (ISSPACE ((const unsigned char)*scan_p)) scan_p++; scan_p--; @@ -3834,7 +3838,7 @@ edit_fn_definition (def_dec_p, clean_text_p) { have_newlines |= (*scan_orig == '\n'); /* Leave identical whitespace alone. */ - if (!ISSPACE (*scan_orig)) + if (!ISSPACE ((const unsigned char)*scan_orig)) *((NONCONST char *)scan_orig) = ' '; /* identical - so whiteout */ } else @@ -3878,7 +3882,7 @@ do_cleaning (new_clean_text_base, new_clean_text_limit) scan_p += 2; while (scan_p[1] != '/' || scan_p[0] != '*') { - if (!ISSPACE (*scan_p)) + if (!ISSPACE ((const unsigned char)*scan_p)) *scan_p = ' '; if (++scan_p >= new_clean_text_limit) abort (); @@ -3893,7 +3897,7 @@ do_cleaning (new_clean_text_base, new_clean_text_limit) *scan_p = ' '; while (scan_p[1] != '\n' || scan_p[0] == '\\') { - if (!ISSPACE (*scan_p)) + if (!ISSPACE ((const unsigned char)*scan_p)) *scan_p = ' '; if (++scan_p >= new_clean_text_limit) abort (); @@ -3905,9 +3909,10 @@ do_cleaning (new_clean_text_base, new_clean_text_limit) non_whitespace_since_newline = 1; while (scan_p[1] != '\'' || scan_p[0] == '\\') { - if (scan_p[0] == '\\' && !ISSPACE (scan_p[1])) + if (scan_p[0] == '\\' + && !ISSPACE ((const unsigned char)scan_p[1])) scan_p[1] = ' '; - if (!ISSPACE (*scan_p)) + if (!ISSPACE ((const unsigned char)*scan_p)) *scan_p = ' '; if (++scan_p >= new_clean_text_limit) abort (); @@ -3919,14 +3924,15 @@ do_cleaning (new_clean_text_base, new_clean_text_limit) non_whitespace_since_newline = 1; while (scan_p[1] != '"' || scan_p[0] == '\\') { - if (scan_p[0] == '\\' && !ISSPACE (scan_p[1])) + if (scan_p[0] == '\\' + && !ISSPACE ((const unsigned char)scan_p[1])) scan_p[1] = ' '; - if (!ISSPACE (*scan_p)) + if (!ISSPACE ((const unsigned char)*scan_p)) *scan_p = ' '; if (++scan_p >= new_clean_text_limit) abort (); } - if (!ISSPACE (*scan_p)) + if (!ISSPACE ((const unsigned char)*scan_p)) *scan_p = ' '; scan_p++; break; @@ -4019,12 +4025,12 @@ scan_for_missed_items (file_p) last_r_paren = scan_p; - for (ahead_p = scan_p + 1; ISSPACE (*ahead_p); ) + for (ahead_p = scan_p + 1; ISSPACE ((const unsigned char)*ahead_p); ) check_source (++ahead_p < limit, limit); scan_p = ahead_p - 1; - if (ISALPHA (*ahead_p) || *ahead_p == '{') + if (ISALPHA ((const unsigned char)*ahead_p) || *ahead_p == '{') { const char *last_l_paren; const int lineno = identify_lineno (ahead_p); @@ -4038,7 +4044,8 @@ scan_for_missed_items (file_p) do { last_l_paren = careful_find_l_paren (last_r_paren); - for (last_r_paren = last_l_paren-1; ISSPACE (*last_r_paren); ) + for (last_r_paren = last_l_paren-1; + ISSPACE ((const unsigned char)*last_r_paren); ) check_source (--last_r_paren >= backup_limit, backup_limit); } while (*last_r_paren == ')'); @@ -4219,7 +4226,8 @@ edit_file (hp) in one swell fwoop. Then figure out where the end of the text is and make sure that it ends with a newline followed by a null. */ - if (safe_read (input_file, new_orig_text_base, orig_size) != orig_size) + if (safe_read (input_file, new_orig_text_base, orig_size) != + (int) orig_size) { int errno_val = errno; close (input_file); @@ -4677,7 +4685,8 @@ main (argc, argv) { const char *cp; - for (cp = varargs_style_indicator; ISALNUM (*cp) || *cp == '_'; cp++) + for (cp = varargs_style_indicator; + ISALNUM ((const unsigned char)*cp) || *cp == '_'; cp++) continue; if (*cp != 0) varargs_style_indicator = savestring (varargs_style_indicator, diff --git a/gcc/recog.c b/gcc/recog.c index 1127cb801e3..97eccbcf6c1 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -1011,7 +1011,7 @@ immediate_operand (op, mode) int const_int_operand (op, mode) register rtx op; - enum machine_mode mode; + enum machine_mode mode ATTRIBUTE_UNUSED; { return GET_CODE (op) == CONST_INT; } diff --git a/gcc/regclass.c b/gcc/regclass.c index cd882df5cd1..601b2f797a6 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -1134,7 +1134,7 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn) enum machine_mode mode = modes[i]; int allows_mem = 0; int win = 0; - char c; + unsigned char c; /* If this operand has no constraints at all, we can conclude nothing about it since anything is valid. */ @@ -1394,7 +1394,7 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn) if (prefclass) alt_cost - += may_move_cost[prefclass[REGNO (op)]][(int) classes[i]]; + += may_move_cost[(unsigned char)prefclass[REGNO (op)]][(int) classes[i]]; } } @@ -1466,9 +1466,9 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn) int nr; if (regno >= FIRST_PSEUDO_REGISTER && prefclass != 0 - && (reg_class_size[prefclass[regno]] + && (reg_class_size[(unsigned char)prefclass[regno]] == CLASS_MAX_NREGS (prefclass[regno], mode))) - op_costs[i].cost[prefclass[regno]] = -1; + op_costs[i].cost[(unsigned char)prefclass[regno]] = -1; else if (regno < FIRST_PSEUDO_REGISTER) for (class = 0; class < N_REG_CLASSES; class++) if (TEST_HARD_REG_BIT (reg_class_contents[class], regno) diff --git a/gcc/reload.c b/gcc/reload.c index 32ee0f57e49..1e438e17b31 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -445,7 +445,7 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode, char insn_letter = insn_operand_constraint[(int) icode][!in_p][in_p]; enum reg_class insn_class = (insn_letter == 'r' ? GENERAL_REGS - : REG_CLASS_FROM_LETTER (insn_letter)); + : REG_CLASS_FROM_LETTER ((unsigned char) insn_letter)); if (insn_class == NO_REGS || (in_p && insn_operand_constraint[(int) icode][!in_p][0] != '=') @@ -462,7 +462,7 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode, class = insn_class; t_mode = insn_operand_mode[(int) icode][2]; t_class = (t_letter == 'r' ? GENERAL_REGS - : REG_CLASS_FROM_LETTER (t_letter)); + : REG_CLASS_FROM_LETTER ((unsigned char) t_letter)); t_icode = icode; icode = CODE_FOR_nothing; } diff --git a/gcc/reload1.c b/gcc/reload1.c index 34f495468cc..36fb75b4ca8 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -1651,10 +1651,10 @@ calculate_needs (chain, avoid_return_reg, global) } else if (size == 1) { - this_needs->regs[reload_nongroup[i]][(int) class] += 1; + this_needs->regs[(unsigned char)reload_nongroup[i]][(int) class] += 1; p = reg_class_superclasses[(int) class]; while (*p != LIM_REG_CLASSES) - this_needs->regs[reload_nongroup[i]][(int) *p++] += 1; + this_needs->regs[(unsigned char)reload_nongroup[i]][(int) *p++] += 1; } else abort (); @@ -2666,7 +2666,7 @@ set_label_offsets (x, insn, initial_p) { enum rtx_code code = GET_CODE (x); rtx tem; - int i; + unsigned int i; struct elim_table *p; switch (code) @@ -2749,7 +2749,7 @@ set_label_offsets (x, insn, initial_p) offsets. We want the first field for ADDR_VEC and the second field for ADDR_DIFF_VEC. */ - for (i = 0; i < XVECLEN (x, code == ADDR_DIFF_VEC); i++) + for (i = 0; i < (unsigned) XVECLEN (x, code == ADDR_DIFF_VEC); i++) set_label_offsets (XVECEXP (x, code == ADDR_DIFF_VEC, i), insn, initial_p); return; @@ -3669,7 +3669,7 @@ mark_not_eliminable (dest, x) rtx dest; rtx x; { - register int i; + register unsigned int i; /* A SUBREG of a hard register here is just changing its mode. We should not see a SUBREG of an eliminable hard register, but check just in @@ -4043,7 +4043,7 @@ hard_reg_use_compare (p1p, p2p) static void order_regs_for_reload () { - register int i; + register unsigned int i; register int o = 0; int large = 0; @@ -4063,7 +4063,7 @@ order_regs_for_reload () hard_reg_n_uses[i].regno = i; } - for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++) + for (i = FIRST_PSEUDO_REGISTER; i < (unsigned) max_regno; i++) { int regno = reg_renumber[i]; if (regno >= 0) @@ -4186,7 +4186,7 @@ reload_as_needed (live_known) /* Reset all offsets on eliminable registers to their initial values. */ #ifdef ELIMINABLE_REGS - for (i = 0; i < NUM_ELIMINABLE_REGS; i++) + for (i = 0; i < (int) NUM_ELIMINABLE_REGS; i++) { INITIAL_ELIMINATION_OFFSET (reg_eliminate[i].from, reg_eliminate[i].to, reg_eliminate[i].initial_offset); @@ -4220,7 +4220,7 @@ reload_as_needed (live_known) if (GET_CODE (insn) == CODE_LABEL) { num_not_at_initial_offset = 0; - for (i = 0; i < NUM_ELIMINABLE_REGS; i++) + for (i = 0; i < (int) NUM_ELIMINABLE_REGS; i++) { reg_eliminate[i].offset = reg_eliminate[i].previous_offset = offsets_at[CODE_LABEL_NUMBER (insn)][i]; @@ -6163,7 +6163,9 @@ choose_reload_regs (chain, avoid_return_reg) if (j == n_reloads) break; +#if 0 fail: +#endif /* Loop around and try without any inheritance. */ /* First undo everything done by the failed attempt to allocate with inheritance. */ @@ -9016,7 +9018,7 @@ reload_cse_simplify_operands (insn) default: class - = reg_class_subunion[(int) class][(int) REG_CLASS_FROM_LETTER (c)]; + = reg_class_subunion[(int) class][(int) REG_CLASS_FROM_LETTER ((unsigned char)c)]; break; case ',': case '\0': @@ -9546,7 +9548,7 @@ reload_combine () The second argument, SET, is ignored. */ static void reload_combine_note_store (dst, set) - rtx dst, set; + rtx dst, set ATTRIBUTE_UNUSED; { int regno = 0; int i; @@ -9562,7 +9564,7 @@ reload_combine_note_store (dst, set) regno += REGNO (dst); /* note_stores might have stripped a STRICT_LOW_PART, so we have to be careful with registers / register parts that are not full words. */ - if (size < UNITS_PER_WORD) + if (size < (unsigned) UNITS_PER_WORD) reg_state[regno].use_index = -1; else { @@ -9799,7 +9801,6 @@ reload_cse_move2add (first) && XEXP (SET_SRC (set), 0) == reg && GET_CODE (XEXP (SET_SRC (set), 1)) == CONST_INT) { - rtx src2 = SET_SRC (set); rtx src3 = XEXP (SET_SRC (set), 1); rtx new_src = GEN_INT (INTVAL (src3) - INTVAL (reg_offset[regno])); diff --git a/gcc/sched.c b/gcc/sched.c index 5fbf7609f4d..78b879ff97b 100644 --- a/gcc/sched.c +++ b/gcc/sched.c @@ -126,6 +126,7 @@ Boston, MA 02111-1307, USA. */ #include "flags.h" #include "insn-config.h" #include "insn-attr.h" +#include "recog.h" #ifndef INSN_SCHEDULING void @@ -325,7 +326,7 @@ static void sched_analyze_1 PROTO((rtx, rtx)); static void sched_analyze_2 PROTO((rtx, rtx)); static void sched_analyze_insn PROTO((rtx, rtx, rtx)); static int sched_analyze PROTO((rtx, rtx)); -static void sched_note_set PROTO((int, rtx, int)); +static void sched_note_set PROTO((rtx, int)); static int rank_for_schedule PROTO((const GENERIC_PTR, const GENERIC_PTR)); static void swap_sort PROTO((rtx *, int)); static void queue_insn PROTO((rtx, int)); @@ -342,7 +343,7 @@ static void finish_sometimes_live PROTO((struct sometimes *, int)); static rtx reemit_notes PROTO((rtx, rtx)); static void schedule_block PROTO((int, FILE *)); static rtx regno_use_in PROTO((int, rtx)); -static void split_hard_reg_notes PROTO((rtx, rtx, rtx, rtx)); +static void split_hard_reg_notes PROTO((rtx, rtx, rtx)); static void new_insn_dead_notes PROTO((rtx, rtx, rtx, rtx)); static void update_n_sets PROTO((rtx, int)); static void update_flow_info PROTO((rtx, rtx, rtx, rtx)); @@ -606,7 +607,7 @@ blockage_range (unit, insn) unsigned int blockage = INSN_BLOCKAGE (insn); unsigned int range; - if (UNIT_BLOCKED (blockage) != unit + 1) + if ((int) UNIT_BLOCKED (blockage) != unit + 1) { range = function_units[unit].blockage_range_function (insn); /* We only cache the blockage range for one unit and then only if @@ -1762,8 +1763,7 @@ sched_analyze (head, tail) are scanning forwards. Mark that register as being born. */ static void -sched_note_set (b, x, death) - int b; +sched_note_set (x, death) rtx x; int death; { @@ -2926,20 +2926,20 @@ schedule_block (b, file) a register must be marked as dead after this insn. */ if (GET_CODE (PATTERN (insn)) == SET || GET_CODE (PATTERN (insn)) == CLOBBER) - sched_note_set (b, PATTERN (insn), 0); + sched_note_set (PATTERN (insn), 0); else if (GET_CODE (PATTERN (insn)) == PARALLEL) { int j; for (j = XVECLEN (PATTERN (insn), 0) - 1; j >= 0; j--) if (GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == SET || GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == CLOBBER) - sched_note_set (b, XVECEXP (PATTERN (insn), 0, j), 0); + sched_note_set (XVECEXP (PATTERN (insn), 0, j), 0); /* ??? This code is obsolete and should be deleted. It is harmless though, so we will leave it in for now. */ for (j = XVECLEN (PATTERN (insn), 0) - 1; j >= 0; j--) if (GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == USE) - sched_note_set (b, XVECEXP (PATTERN (insn), 0, j), 0); + sched_note_set (XVECEXP (PATTERN (insn), 0, j), 0); } /* Each call clobbers (makes live) all call-clobbered regs @@ -3036,20 +3036,20 @@ schedule_block (b, file) must be marked as dead after this insn. */ if (GET_CODE (PATTERN (insn)) == SET || GET_CODE (PATTERN (insn)) == CLOBBER) - sched_note_set (b, PATTERN (insn), 0); + sched_note_set (PATTERN (insn), 0); else if (GET_CODE (PATTERN (insn)) == PARALLEL) { int j; for (j = XVECLEN (PATTERN (insn), 0) - 1; j >= 0; j--) if (GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == SET || GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == CLOBBER) - sched_note_set (b, XVECEXP (PATTERN (insn), 0, j), 0); + sched_note_set (XVECEXP (PATTERN (insn), 0, j), 0); /* ??? This code is obsolete and should be deleted. It is harmless though, so we will leave it in for now. */ for (j = XVECLEN (PATTERN (insn), 0) - 1; j >= 0; j--) if (GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == USE) - sched_note_set (b, XVECEXP (PATTERN (insn), 0, j), 0); + sched_note_set (XVECEXP (PATTERN (insn), 0, j), 0); } /* Each call clobbers (makes live) all call-clobbered regs that are @@ -3279,14 +3279,14 @@ schedule_block (b, file) /* See if this is the last notice we must take of a register. */ if (GET_CODE (PATTERN (insn)) == SET || GET_CODE (PATTERN (insn)) == CLOBBER) - sched_note_set (b, PATTERN (insn), 1); + sched_note_set (PATTERN (insn), 1); else if (GET_CODE (PATTERN (insn)) == PARALLEL) { int j; for (j = XVECLEN (PATTERN (insn), 0) - 1; j >= 0; j--) if (GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == SET || GET_CODE (XVECEXP (PATTERN (insn), 0, j)) == CLOBBER) - sched_note_set (b, XVECEXP (PATTERN (insn), 0, j), 1); + sched_note_set (XVECEXP (PATTERN (insn), 0, j), 1); } /* This code keeps life analysis information up to date. */ @@ -3593,8 +3593,8 @@ regno_use_in (regno, x) several smaller hard register references in the split insns. */ static void -split_hard_reg_notes (note, first, last, orig_insn) - rtx note, first, last, orig_insn; +split_hard_reg_notes (note, first, last) + rtx note, first, last; { rtx reg, temp, link; int n_regs, i, new_reg; @@ -3823,7 +3823,7 @@ update_flow_info (notes, first, last, orig_insn) && GET_CODE (temp) == REG && REGNO (temp) < FIRST_PSEUDO_REGISTER && HARD_REGNO_NREGS (REGNO (temp), GET_MODE (temp)) > 1) - split_hard_reg_notes (note, first, last, orig_insn); + split_hard_reg_notes (note, first, last); else { XEXP (note, 1) = REG_NOTES (insn); diff --git a/gcc/stupid.c b/gcc/stupid.c index cd1329f83d7..8af1e3cc093 100644 --- a/gcc/stupid.c +++ b/gcc/stupid.c @@ -497,7 +497,7 @@ stupid_find_reg (call_preserved, class, mode, enum reg_class class; enum machine_mode mode; int born_insn, dead_insn; - int changes_size; + int changes_size ATTRIBUTE_UNUSED; { register int i, ins; #ifdef HARD_REG_SET @@ -519,7 +519,7 @@ stupid_find_reg (call_preserved, class, mode, call_preserved ? call_used_reg_set : fixed_reg_set); #ifdef ELIMINABLE_REGS - for (i = 0; i < sizeof eliminables / sizeof eliminables[0]; i++) + for (i = 0; i < (int)(sizeof eliminables / sizeof eliminables[0]); i++) SET_HARD_REG_BIT (used, eliminables[i].from); #if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM SET_HARD_REG_BIT (used, HARD_FRAME_POINTER_REGNUM); diff --git a/gcc/unroll.c b/gcc/unroll.c index 3222e207890..034fe52a0e9 100644 --- a/gcc/unroll.c +++ b/gcc/unroll.c @@ -198,7 +198,7 @@ enum rtx_code loop_comparison_code; /* Forward declarations. */ static void init_reg_map PROTO((struct inline_remap *, int)); -static int precondition_loop_p PROTO((rtx *, rtx *, rtx *, rtx, rtx)); +static int precondition_loop_p PROTO((rtx *, rtx *, rtx *, rtx)); static rtx calculate_giv_inc PROTO((rtx, rtx, int)); static rtx initial_reg_note_copy PROTO((rtx, struct inline_remap *)); static void final_reg_note_copy PROTO((rtx, struct inline_remap *)); @@ -858,7 +858,7 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before, rtx initial_value, final_value, increment; if (precondition_loop_p (&initial_value, &final_value, &increment, - loop_start, loop_end)) + loop_start)) { register rtx diff ; enum machine_mode mode; @@ -1319,10 +1319,9 @@ unroll_loop (loop_end, insn_count, loop_start, end_insert_before, whether divide is cheap. */ static int -precondition_loop_p (initial_value, final_value, increment, loop_start, - loop_end) +precondition_loop_p (initial_value, final_value, increment, loop_start) rtx *initial_value, *final_value, *increment; - rtx loop_start, loop_end; + rtx loop_start; { if (loop_n_iterations > 0) |