summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-12-11 13:41:59 +0000
committerNick Clifton <nickc@redhat.com>2009-12-11 13:41:59 +0000
commit0ae5ed34cd818c894f9633ce356d1f39067d6dab (patch)
treec4ff227f63cb55ba2b14b460ba2cd633413fce03 /cpu
parent03978e229064bebbca9f30bd553ae88c82fbb986 (diff)
downloadgdb-0ae5ed34cd818c894f9633ce356d1f39067d6dab.tar.gz
Add -Wshadow to the gcc command line options used when compiling the binutils.
Fix up all warnings generated by the addition of this switch.
Diffstat (limited to 'cpu')
-rw-r--r--cpu/ChangeLog5
-rw-r--r--cpu/frv.opc12
-rw-r--r--cpu/m32c.opc69
3 files changed, 43 insertions, 43 deletions
diff --git a/cpu/ChangeLog b/cpu/ChangeLog
index a627b44032d..355cc7c5fc7 100644
--- a/cpu/ChangeLog
+++ b/cpu/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-11 Nick Clifton <nickc@redhat.com>
+
+ * frv.opc: Fix shadowed variable warnings.
+ * m32c.opc: Fix shadowed variable warnings.
+
2009-11-14 Doug Evans <dje@sebabeach.org>
Must use VOID expression in VOID context.
diff --git a/cpu/frv.opc b/cpu/frv.opc
index 0b9c93c8dc4..3dfadb3b9ba 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 bc983ea3e05..d2b073db063 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 = ",";
}
}