From 5413b5486ba77949122a8bfd6067d31626e330f3 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 11 Dec 2009 13:41:59 +0000 Subject: Add -Wshadow to the gcc command line options used when compiling the binutils. Fix up all warnings generated by the addition of this switch. --- cpu/ChangeLog | 5 +++++ cpu/frv.opc | 12 +++++------ cpu/m32c.opc | 69 +++++++++++++++++++++++++++-------------------------------- 3 files changed, 43 insertions(+), 43 deletions(-) (limited to 'cpu') diff --git a/cpu/ChangeLog b/cpu/ChangeLog index a627b44032..355cc7c5fc 100644 --- a/cpu/ChangeLog +++ b/cpu/ChangeLog @@ -1,3 +1,8 @@ +2009-12-11 Nick Clifton + + * frv.opc: Fix shadowed variable warnings. + * m32c.opc: Fix shadowed variable warnings. + 2009-11-14 Doug Evans Must use VOID expression in VOID context. diff --git a/cpu/frv.opc b/cpu/frv.opc index 0b9c93c8dc..3dfadb3b9b 100644 --- a/cpu/frv.opc +++ b/cpu/frv.opc @@ -842,7 +842,7 @@ check_insn_major_constraints (FRV_VLIW *vliw, int frv_vliw_add_insn (FRV_VLIW *vliw, const CGEN_INSN *insn) { - int index; + int slot_index; CGEN_ATTR_VALUE_ENUM_TYPE major; CGEN_ATTR_VALUE_ENUM_TYPE unit; VLIW_COMBO *new_vliw; @@ -850,8 +850,8 @@ frv_vliw_add_insn (FRV_VLIW *vliw, const CGEN_INSN *insn) if (vliw->constraint_violation || CGEN_INSN_INVALID_P (insn)) return 1; - index = vliw->next_slot; - if (index >= FRV_VLIW_SIZE) + slot_index = vliw->next_slot; + if (slot_index >= FRV_VLIW_SIZE) return 1; unit = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_UNIT); @@ -878,7 +878,7 @@ frv_vliw_add_insn (FRV_VLIW *vliw, const CGEN_INSN *insn) break; } - if (index <= 0) + if (slot_index <= 0) { /* Any insn can be added to slot 0. */ while (! match_unit (vliw, unit, (*vliw->current_vliw)[0])) @@ -898,8 +898,8 @@ frv_vliw_add_insn (FRV_VLIW *vliw, const CGEN_INSN *insn) if (new_vliw && check_insn_major_constraints (vliw, major, insn)) { vliw->current_vliw = new_vliw; - vliw->major[index] = major; - vliw->insn[index] = insn; + vliw->major[slot_index] = major; + vliw->insn[slot_index] = insn; vliw->next_slot++; return 0; } diff --git a/cpu/m32c.opc b/cpu/m32c.opc index bc983ea3e0..d2b073db06 100644 --- a/cpu/m32c.opc +++ b/cpu/m32c.opc @@ -156,27 +156,26 @@ parse_unsigned8 (CGEN_CPU_DESC cd, const char **strp, int opindex, unsigned long *valuep) { const char *errmsg = 0; - unsigned long value; + unsigned long value = 0; long have_zero = 0; if (strncasecmp (*strp, "%dsp8(", 6) == 0) { enum cgen_parse_operand_result result_type; - bfd_vma value; - const char *errmsg; + bfd_vma val; *strp += 6; errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_8, - & result_type, & value); + & result_type, & val); if (**strp != ')') return _("missing `)'"); (*strp) ++; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) - { - return _("%dsp8() takes a symbolic address, not a number"); - } + return _("%dsp8() takes a symbolic address, not a number"); + + value = val; *valuep = value; return errmsg; } @@ -253,26 +252,25 @@ parse_signed8 (CGEN_CPU_DESC cd, const char **strp, int opindex, signed long *valuep) { const char *errmsg = 0; - signed long value; + signed long value = 0; if (strncasecmp (*strp, "%hi8(", 5) == 0) { enum cgen_parse_operand_result result_type; - bfd_vma value; - const char *errmsg; + bfd_vma val; *strp += 5; errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_M32C_HI8, - & result_type, & value); + & result_type, & val); if (**strp != ')') return _("missing `)'"); (*strp) ++; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) - { - value >>= 16; - } + val >>= 16; + + value = val; *valuep = value; return errmsg; } @@ -294,27 +292,26 @@ parse_unsigned16 (CGEN_CPU_DESC cd, const char **strp, int opindex, unsigned long *valuep) { const char *errmsg = 0; - unsigned long value; + unsigned long value = 0; long have_zero = 0; if (strncasecmp (*strp, "%dsp16(", 7) == 0) { enum cgen_parse_operand_result result_type; - bfd_vma value; - const char *errmsg; + bfd_vma val; *strp += 7; errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_16, - & result_type, & value); + & result_type, & val); if (**strp != ')') return _("missing `)'"); (*strp) ++; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) - { - return _("%dsp16() takes a symbolic address, not a number"); - } + return _("%dsp16() takes a symbolic address, not a number"); + + value = val; *valuep = value; return errmsg; } @@ -354,26 +351,25 @@ parse_signed16 (CGEN_CPU_DESC cd, const char **strp, int opindex, signed long *valuep) { const char *errmsg = 0; - signed long value; + signed long value = 0; if (strncasecmp (*strp, "%lo16(", 6) == 0) { enum cgen_parse_operand_result result_type; - bfd_vma value; - const char *errmsg; + bfd_vma val; *strp += 6; errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_LO16, - & result_type, & value); + & result_type, & val); if (**strp != ')') return _("missing `)'"); (*strp) ++; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) - { - value &= 0xffff; - } + value &= 0xffff; + + value = val; *valuep = value; return errmsg; } @@ -381,21 +377,20 @@ parse_signed16 (CGEN_CPU_DESC cd, const char **strp, if (strncasecmp (*strp, "%hi16(", 6) == 0) { enum cgen_parse_operand_result result_type; - bfd_vma value; - const char *errmsg; + bfd_vma val; *strp += 6; errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_HI16, - & result_type, & value); + & result_type, & val); if (**strp != ')') return _("missing `)'"); (*strp) ++; if (errmsg == NULL && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) - { - value >>= 16; - } + val >>= 16; + + value = val; *valuep = value; return errmsg; } @@ -1121,7 +1116,7 @@ print_regset (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, }; disassemble_info *info = dis_info; int mask; - int index = 0; + int reg_index = 0; char* comma = ""; if (push) @@ -1135,7 +1130,7 @@ print_regset (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, comma = ","; } - for (index = 1; index <= 7; ++index) + for (reg_index = 1; reg_index <= 7; ++reg_index) { if (push) mask >>= 1; @@ -1145,7 +1140,7 @@ print_regset (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, if (value & mask) { (*info->fprintf_func) (info->stream, "%s%s", comma, - m16c_register_names [index]); + m16c_register_names [reg_index]); comma = ","; } } -- cgit v1.2.1