diff options
Diffstat (limited to 'gas')
44 files changed, 933 insertions, 890 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 5c1a556..c38f445 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,49 @@ +2009-12-11 Nick Clifton <nickc@redhat.com> + + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * configure: Regenerate. + * dw2gencfi.c: Fix shadowed variable warnings. + * dwarf2dbg.c: Likewise. + * expr.c: Likewise. + * hash.c: Likewise. + * listing.c: Likewise. + * macro.c: Likewise. + * read.c: Likewise. + * stabs.c: Likewise. + * symbols.c: Likewise. + * write.c: Likewise. + * config/bfin-parse.y: Likewise. + * config/obj-coff.c: Likewise. + * config/tc-arm.c: Likewise. + * config/tc-bfin.c: Likewise. + * config/tc-cr16.c: Likewise. + * config/tc-crx.c: Likewise. + * config/tc-d10v.c: Likewise. + * config/tc-d30v.c: Likewise. + * config/tc-frv.c: Likewise. + * config/tc-i370.c: Likewise. + * config/tc-i386-intel.c: Likewise. + * config/tc-i386.c: Likewise. + * config/tc-ia64.c: Likewise. + * config/tc-m32r.c: Likewise. + * config/tc-m68hc11.c: Likewise. + * config/tc-mips.c: Likewise. + * config/tc-mn10200.c: Likewise. + * config/tc-mn10300.c: Likewise. + * config/tc-ns32k.c: Likewise. + * config/tc-ppc.c: Likewise. + * config/tc-score.c: Likewise. + * config/tc-score7.c: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-sh64.c: Likewise. + * config/tc-sparc.c: Likewise. + * config/tc-tic30.c: Likewise. + * config/tc-tic4x.c: Likewise. + * config/tc-tic54x.c: Likewise. + * config/tc-xtensa.c: Likewise. + * config/tc-z8k.c: Likewise. + 2009-12-09 H.J. Lu <hongjiu.lu@intel.com> * config/tc-i386.c (arch_entry): Add len and skip. diff --git a/gas/Makefile.in b/gas/Makefile.in index 5aa485e..f75424c 100644 --- a/gas/Makefile.in +++ b/gas/Makefile.in @@ -48,12 +48,15 @@ DIST_COMMON = NEWS README ChangeLog $(srcdir)/Makefile.in \ $(srcdir)/../ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \ + $(top_srcdir)/../config/zlib.m4 \ $(top_srcdir)/../bfd/warning.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/gettext-sister.m4 \ + $(top_srcdir)/../config/largefile.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/nls.m4 \ $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/plugins.m4 \ $(top_srcdir)/../config/po.m4 \ $(top_srcdir)/../config/progtest.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ diff --git a/gas/config/bfin-parse.y b/gas/config/bfin-parse.y index 003e41a..3112460 100644 --- a/gas/config/bfin-parse.y +++ b/gas/config/bfin-parse.y @@ -193,10 +193,10 @@ yyerror (char *msg) } static int -in_range_p (Expr_Node *expr, int from, int to, unsigned int mask) +in_range_p (Expr_Node *exp, int from, int to, unsigned int mask) { - int val = EXPR_VALUE (expr); - if (expr->type != Expr_Node_Constant) + int val = EXPR_VALUE (exp); + if (exp->type != Expr_Node_Constant) return 0; if (val < from || val > to) return 0; @@ -4411,13 +4411,13 @@ mkexpr (int x, SYMBOL_T s) } static int -value_match (Expr_Node *expr, int sz, int sign, int mul, int issigned) +value_match (Expr_Node *exp, int sz, int sign, int mul, int issigned) { int umax = (1 << sz) - 1; int min = -1 << (sz - 1); int max = (1 << (sz - 1)) - 1; - int v = (EXPR_VALUE (expr)) & 0xffffffff; + int v = (EXPR_VALUE (exp)) & 0xffffffff; if ((v % mul) != 0) { diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index d4fb10d..aa621b9 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -621,14 +621,11 @@ obj_coff_def (int what ATTRIBUTE_UNUSED) demand_empty_rest_of_line (); } -unsigned int dim_index; - static void obj_coff_endef (int ignore ATTRIBUTE_UNUSED) { symbolS *symbolP = NULL; - dim_index = 0; if (def_symbol_in_progress == NULL) { as_warn (_(".endef pseudo-op used outside of .def/.endef: ignored.")); @@ -861,7 +858,7 @@ obj_coff_endef (int ignore ATTRIBUTE_UNUSED) static void obj_coff_dim (int ignore ATTRIBUTE_UNUSED) { - int dim_index; + int d_index; if (def_symbol_in_progress == NULL) { @@ -872,10 +869,10 @@ obj_coff_dim (int ignore ATTRIBUTE_UNUSED) S_SET_NUMBER_AUXILIARY (def_symbol_in_progress, 1); - for (dim_index = 0; dim_index < DIMNUM; dim_index++) + for (d_index = 0; d_index < DIMNUM; d_index++) { SKIP_WHITESPACES (); - SA_SET_SYM_DIMEN (def_symbol_in_progress, dim_index, + SA_SET_SYM_DIMEN (def_symbol_in_progress, d_index, get_absolute_expression ()); switch (*input_line_pointer) @@ -889,7 +886,7 @@ obj_coff_dim (int ignore ATTRIBUTE_UNUSED) /* Fall through. */ case '\n': case ';': - dim_index = DIMNUM; + d_index = DIMNUM; break; } } diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 076c82b..16e65d2 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -1052,10 +1052,10 @@ md_atof (int type, char * litP, int * sizeP) /* We handle all bad expressions here, so that we can report the faulty instruction in the error message. */ void -md_operand (expressionS * expr) +md_operand (expressionS * exp) { if (in_my_get_expression) - expr->X_op = O_illegal; + exp->X_op = O_illegal; } /* Immediate values. */ @@ -1583,23 +1583,23 @@ parse_reg_list (char ** strp) } else { - expressionS expr; + expressionS exp; - if (my_get_expression (&expr, &str, GE_NO_PREFIX)) + if (my_get_expression (&exp, &str, GE_NO_PREFIX)) return FAIL; - if (expr.X_op == O_constant) + if (exp.X_op == O_constant) { - if (expr.X_add_number - != (expr.X_add_number & 0x0000ffff)) + if (exp.X_add_number + != (exp.X_add_number & 0x0000ffff)) { inst.error = _("invalid register mask"); return FAIL; } - if ((range & expr.X_add_number) != 0) + if ((range & exp.X_add_number) != 0) { - int regno = range & expr.X_add_number; + int regno = range & exp.X_add_number; regno &= -regno; regno = (1 << regno) - 1; @@ -1608,7 +1608,7 @@ parse_reg_list (char ** strp) regno); } - range |= expr.X_add_number; + range |= exp.X_add_number; } else { @@ -1618,7 +1618,7 @@ parse_reg_list (char ** strp) return FAIL; } - memcpy (&inst.reloc.exp, &expr, sizeof (expressionS)); + memcpy (&inst.reloc.exp, &exp, sizeof (expressionS)); inst.reloc.type = BFD_RELOC_ARM_MULTI; inst.reloc.pc_rel = 0; } @@ -4711,7 +4711,7 @@ static int parse_shifter_operand (char **str, int i) { int value; - expressionS expr; + expressionS exp; if ((value = arm_reg_parse (str, REG_TYPE_RN)) != FAIL) { @@ -4735,16 +4735,16 @@ parse_shifter_operand (char **str, int i) if (skip_past_comma (str) == SUCCESS) { /* #x, y -- ie explicit rotation by Y. */ - if (my_get_expression (&expr, str, GE_NO_PREFIX)) + if (my_get_expression (&exp, str, GE_NO_PREFIX)) return FAIL; - if (expr.X_op != O_constant || inst.reloc.exp.X_op != O_constant) + if (exp.X_op != O_constant || inst.reloc.exp.X_op != O_constant) { inst.error = _("constant expression expected"); return FAIL; } - value = expr.X_add_number; + value = exp.X_add_number; if (value < 0 || value > 30 || value % 2 != 0) { inst.error = _("invalid rotation"); @@ -14163,12 +14163,13 @@ do_neon_mov (void) case NS_SR: /* case 4. */ { unsigned bcdebits = 0; - struct neon_type_el et = neon_check_type (2, NS_NULL, - N_8 | N_16 | N_32 | N_KEY, N_EQK); - int logsize = neon_logbits (et.size); + int logsize; unsigned dn = NEON_SCALAR_REG (inst.operands[0].reg); unsigned x = NEON_SCALAR_INDEX (inst.operands[0].reg); + et = neon_check_type (2, NS_NULL, N_8 | N_16 | N_32 | N_KEY, N_EQK); + logsize = neon_logbits (et.size); + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v1), _(BAD_FPU)); constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_neon_ext_v1) @@ -14210,13 +14211,15 @@ do_neon_mov (void) case NS_RS: /* case 6. */ { - struct neon_type_el et = neon_check_type (2, NS_NULL, - N_EQK, N_S8 | N_S16 | N_U8 | N_U16 | N_32 | N_KEY); - unsigned logsize = neon_logbits (et.size); + unsigned logsize; unsigned dn = NEON_SCALAR_REG (inst.operands[1].reg); unsigned x = NEON_SCALAR_INDEX (inst.operands[1].reg); unsigned abcdebits = 0; + et = neon_check_type (2, NS_NULL, + N_EQK, N_S8 | N_S16 | N_U8 | N_U16 | N_32 | N_KEY); + logsize = neon_logbits (et.size); + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_v1), _(BAD_FPU)); constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_neon_ext_v1) @@ -19126,12 +19129,12 @@ tc_arm_regname_to_dw2regnum (char *regname) void tc_pe_dwarf2_emit_offset (symbolS *symbol, unsigned int size) { - expressionS expr; + expressionS exp; - expr.X_op = O_secrel; - expr.X_add_symbol = symbol; - expr.X_add_number = 0; - emit_expr (&expr, size); + exp.X_op = O_secrel; + exp.X_add_symbol = symbol; + exp.X_add_number = 0; + emit_expr (&exp, size); } #endif @@ -22602,18 +22605,18 @@ aeabi_set_public_attributes (void) /* Tag_CPU_name. */ if (selected_cpu_name[0]) { - char *p; + char *q; - p = selected_cpu_name; - if (strncmp (p, "armv", 4) == 0) + q = selected_cpu_name; + if (strncmp (q, "armv", 4) == 0) { int i; - p += 4; - for (i = 0; p[i]; i++) - p[i] = TOUPPER (p[i]); + q += 4; + for (i = 0; q[i]; i++) + q[i] = TOUPPER (q[i]); } - aeabi_set_attribute_string (Tag_CPU_name, p); + aeabi_set_attribute_string (Tag_CPU_name, q); } /* Tag_CPU_arch. */ diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c index adbc3e4..d988890 100644 --- a/gas/config/tc-bfin.c +++ b/gas/config/tc-bfin.c @@ -1134,6 +1134,7 @@ Expr_Node_Gen_Reloc_R (Expr_Node * head) #define INIT(t) t c_code = init_##t #define ASSIGN(x) c_code.opcode |= ((x & c_code.mask_##x)<<c_code.bits_##x) +#define ASSIGNF(x,f) c_code.opcode |= ((x & c_code.mask_##f)<<c_code.bits_##f) #define ASSIGN_R(x) c_code.opcode |= (((x ? (x->regno & CODE_MASK) : 0) & c_code.mask_##x)<<c_code.bits_##x) #define HI(x) ((x >> 16) & 0xffff) @@ -1302,13 +1303,13 @@ bfin_gen_calla (Expr_Node * addr, int S) { int val; int high_val; - int reloc = 0; + int rel = 0; INIT (CALLa); switch(S){ - case 0 : reloc = BFD_RELOC_BFIN_24_PCREL_JUMP_L; break; - case 1 : reloc = BFD_RELOC_24_PCREL; break; - case 2 : reloc = BFD_RELOC_BFIN_PLTPC; break; + case 0 : rel = BFD_RELOC_BFIN_24_PCREL_JUMP_L; break; + case 1 : rel = BFD_RELOC_24_PCREL; break; + case 2 : rel = BFD_RELOC_BFIN_PLTPC; break; default : break; } @@ -1318,7 +1319,7 @@ bfin_gen_calla (Expr_Node * addr, int S) high_val = val >> 16; return conscode (gencode (HI (c_code.opcode) | (high_val & 0xff)), - Expr_Node_Gen_Reloc (addr, reloc)); + Expr_Node_Gen_Reloc (addr, rel)); } INSTR_T @@ -1336,7 +1337,7 @@ bfin_gen_linkage (int R, int framesize) /* Load and Store. */ INSTR_T -bfin_gen_ldimmhalf (REG_T reg, int H, int S, int Z, Expr_Node * phword, int reloc) +bfin_gen_ldimmhalf (REG_T reg, int H, int S, int Z, Expr_Node * phword, int rel) { int grp, hword; unsigned val = EXPR_VALUE (phword); @@ -1349,11 +1350,11 @@ bfin_gen_ldimmhalf (REG_T reg, int H, int S, int Z, Expr_Node * phword, int relo ASSIGN_R (reg); grp = (GROUP (reg)); ASSIGN (grp); - if (reloc == 2) + if (rel == 2) { return conscode (gencode (HI (c_code.opcode)), Expr_Node_Gen_Reloc (phword, BFD_RELOC_BFIN_16_IMM)); } - else if (reloc == 1) + else if (rel == 1) { return conscode (gencode (HI (c_code.opcode)), Expr_Node_Gen_Reloc (phword, IS_H (*reg) ? BFD_RELOC_BFIN_16_HIGH : BFD_RELOC_BFIN_16_LOW)); } @@ -1450,20 +1451,19 @@ bfin_gen_ldst (REG_T ptr, REG_T reg, int aop, int sz, int Z, int W) } INSTR_T -bfin_gen_ldstii (REG_T ptr, REG_T reg, Expr_Node * poffset, int W, int op) +bfin_gen_ldstii (REG_T ptr, REG_T reg, Expr_Node * poffset, int W, int opc) { int offset; int value = 0; INIT (LDSTii); - if (!IS_PREG (*ptr)) { fprintf (stderr, "Warning: possible mixup of Preg/Dreg\n"); return 0; } - switch (op) + switch (opc) { case 1: case 2: @@ -1481,7 +1481,7 @@ bfin_gen_ldstii (REG_T ptr, REG_T reg, Expr_Node * poffset, int W, int op) offset = value; ASSIGN (offset); ASSIGN (W); - ASSIGN (op); + ASSIGNF (opc, op); return GEN_OPCODE16 (); } @@ -1580,48 +1580,48 @@ bfin_gen_alu2op (REG_T dst, REG_T src, int opc) } INSTR_T -bfin_gen_compi2opd (REG_T dst, int src, int op) +bfin_gen_compi2opd (REG_T dst, int src, int opc) { INIT (COMPI2opD); ASSIGN_R (dst); ASSIGN (src); - ASSIGN (op); + ASSIGNF (opc, op); return GEN_OPCODE16 (); } INSTR_T -bfin_gen_compi2opp (REG_T dst, int src, int op) +bfin_gen_compi2opp (REG_T dst, int src, int opc) { INIT (COMPI2opP); ASSIGN_R (dst); ASSIGN (src); - ASSIGN (op); + ASSIGNF (opc, op); return GEN_OPCODE16 (); } INSTR_T -bfin_gen_dagmodik (REG_T i, int op) +bfin_gen_dagmodik (REG_T i, int opc) { INIT (DagMODik); ASSIGN_R (i); - ASSIGN (op); + ASSIGNF (opc, op); return GEN_OPCODE16 (); } INSTR_T -bfin_gen_dagmodim (REG_T i, REG_T m, int op, int br) +bfin_gen_dagmodim (REG_T i, REG_T m, int opc, int br) { INIT (DagMODim); ASSIGN_R (i); ASSIGN_R (m); - ASSIGN (op); + ASSIGNF (opc, op); ASSIGN (br); return GEN_OPCODE16 (); @@ -1684,12 +1684,12 @@ bfin_gen_ccmv (REG_T src, REG_T dst, int T) } INSTR_T -bfin_gen_cc2stat (int cbit, int op, int D) +bfin_gen_cc2stat (int cbit, int opc, int D) { INIT (CC2stat); ASSIGN (cbit); - ASSIGN (op); + ASSIGNF (opc, op); ASSIGN (D); return GEN_OPCODE16 (); @@ -1713,11 +1713,11 @@ bfin_gen_regmv (REG_T src, REG_T dst) } INSTR_T -bfin_gen_cc2dreg (int op, REG_T reg) +bfin_gen_cc2dreg (int opc, REG_T reg) { INIT (CC2dreg); - ASSIGN (op); + ASSIGNF (opc, op); ASSIGN_R (reg); return GEN_OPCODE16 (); @@ -1735,13 +1735,13 @@ bfin_gen_progctrl (int prgfunc, int poprnd) } INSTR_T -bfin_gen_cactrl (REG_T reg, int a, int op) +bfin_gen_cactrl (REG_T reg, int a, int opc) { INIT (CaCTRL); ASSIGN_R (reg); ASSIGN (a); - ASSIGN (op); + ASSIGNF (opc, op); return GEN_OPCODE16 (); } @@ -1841,14 +1841,14 @@ bfin_gen_multi_instr (INSTR_T dsp32, INSTR_T dsp16_grp1, INSTR_T dsp16_grp2) } INSTR_T -bfin_gen_loop (Expr_Node *expr, REG_T reg, int rop, REG_T preg) +bfin_gen_loop (Expr_Node *exp, REG_T reg, int rop, REG_T preg) { const char *loopsym; char *lbeginsym, *lendsym; Expr_Node_Value lbeginval, lendval; Expr_Node *lbegin, *lend; - loopsym = expr->value.s_value; + loopsym = exp->value.s_value; lbeginsym = (char *) xmalloc (strlen (loopsym) + strlen ("__BEGIN") + 5); lendsym = (char *) xmalloc (strlen (loopsym) + strlen ("__END") + 5); @@ -1875,14 +1875,14 @@ bfin_gen_loop (Expr_Node *expr, REG_T reg, int rop, REG_T preg) } void -bfin_loop_beginend (Expr_Node *expr, int begin) +bfin_loop_beginend (Expr_Node *exp, int begin) { const char *loopsym; char *label_name; - symbolS *line_label; + symbolS *linelabel; const char *suffix = begin ? "__BEGIN" : "__END"; - loopsym = expr->value.s_value; + loopsym = exp->value.s_value; label_name = (char *) xmalloc (strlen (loopsym) + strlen (suffix) + 5); label_name[0] = 0; @@ -1891,12 +1891,12 @@ bfin_loop_beginend (Expr_Node *expr, int begin) strcat (label_name, loopsym); strcat (label_name, suffix); - line_label = colon (label_name); + linelabel = colon (label_name); /* LOOP_END follows the last instruction in the loop. Adjust label address. */ if (!begin) - ((struct local_symbol *) line_label)->lsy_value -= last_insn_size; + ((struct local_symbol *) linelabel)->lsy_value -= last_insn_size; } bfd_boolean @@ -2018,9 +2018,9 @@ decode_dagMODim_0 (int iw0) | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 |.br| 1 | 1 |.op|.m.....|.i.....| +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */ int i = ((iw0 >> DagMODim_i_bits) & DagMODim_i_mask); - int op = ((iw0 >> DagMODim_op_bits) & DagMODim_op_mask); + int opc = ((iw0 >> DagMODim_op_bits) & DagMODim_op_mask); - if (op == 0 || op == 1) + if (opc == 0 || opc == 1) return IREG_MASK (i); else return 0; @@ -2199,18 +2199,18 @@ decode_LDSTii_0 (int iw0) | 1 | 0 | 1 |.W.|.op....|.offset........|.ptr.......|.reg.......| +---+---+---+---|---+---+---+---|---+---+---+---|---+---+---+---+ */ int reg = ((iw0 >> LDSTii_reg_bit) & LDSTii_reg_mask); - int op = ((iw0 >> LDSTii_op_bit) & LDSTii_op_mask); + int opc = ((iw0 >> LDSTii_op_bit) & LDSTii_op_mask); int W = ((iw0 >> LDSTii_W_bit) & LDSTii_W_mask); - if (W == 0 && op != 3) + if (W == 0 && opc != 3) return DREG_MASK (reg); - else if (W == 0 && op == 3) + else if (W == 0 && opc == 3) return 0; - else if (W == 1 && op == 0) + else if (W == 1 && opc == 0) return 0; - else if (W == 1 && op == 1) + else if (W == 1 && opc == 1) return 0; - else if (W == 1 && op == 3) + else if (W == 1 && opc == 3) return 0; abort (); diff --git a/gas/config/tc-cr16.c b/gas/config/tc-cr16.c index 1ed74cd..2a5b2f7 100644 --- a/gas/config/tc-cr16.c +++ b/gas/config/tc-cr16.c @@ -317,12 +317,12 @@ get_cc (char *cc_name) static reg get_register (char *reg_name) { - const reg_entry *reg; + const reg_entry *rreg; - reg = (const reg_entry *) hash_find (reg_hash, reg_name); + rreg = (const reg_entry *) hash_find (reg_hash, reg_name); - if (reg != NULL) - return reg->value.reg_val; + if (rreg != NULL) + return rreg->value.reg_val; return nullregister; } @@ -331,7 +331,7 @@ get_register (char *reg_name) static reg get_register_pair (char *reg_name) { - const reg_entry *reg; + const reg_entry *rreg; char tmp_rp[16]="\0"; /* Add '(' and ')' to the reg pair, if its not present. */ @@ -340,13 +340,13 @@ get_register_pair (char *reg_name) tmp_rp[0] = '('; strcat (tmp_rp, reg_name); strcat (tmp_rp,")"); - reg = (const reg_entry *) hash_find (regp_hash, tmp_rp); + rreg = (const reg_entry *) hash_find (regp_hash, tmp_rp); } else - reg = (const reg_entry *) hash_find (regp_hash, reg_name); + rreg = (const reg_entry *) hash_find (regp_hash, reg_name); - if (reg != NULL) - return reg->value.reg_val; + if (rreg != NULL) + return rreg->value.reg_val; return nullregister; } @@ -356,13 +356,13 @@ get_register_pair (char *reg_name) static reg get_index_register (char *reg_name) { - const reg_entry *reg; + const reg_entry *rreg; - reg = (const reg_entry *) hash_find (reg_hash, reg_name); + rreg = (const reg_entry *) hash_find (reg_hash, reg_name); - if ((reg != NULL) - && ((reg->value.reg_val == 12) || (reg->value.reg_val == 13))) - return reg->value.reg_val; + if ((rreg != NULL) + && ((rreg->value.reg_val == 12) || (rreg->value.reg_val == 13))) + return rreg->value.reg_val; return nullregister; } @@ -371,17 +371,17 @@ get_index_register (char *reg_name) static reg get_index_register_pair (char *reg_name) { - const reg_entry *reg; + const reg_entry *rreg; - reg = (const reg_entry *) hash_find (regp_hash, reg_name); + rreg = (const reg_entry *) hash_find (regp_hash, reg_name); - if (reg != NULL) + if (rreg != NULL) { - if ((reg->value.reg_val != 1) || (reg->value.reg_val != 7) - || (reg->value.reg_val != 9) || (reg->value.reg_val > 10)) - return reg->value.reg_val; + if ((rreg->value.reg_val != 1) || (rreg->value.reg_val != 7) + || (rreg->value.reg_val != 9) || (rreg->value.reg_val > 10)) + return rreg->value.reg_val; - as_bad (_("Unknown register pair - index relative mode: `%d'"), reg->value.reg_val); + as_bad (_("Unknown register pair - index relative mode: `%d'"), rreg->value.reg_val); } return nullregister; @@ -392,12 +392,12 @@ get_index_register_pair (char *reg_name) static preg get_pregister (char *preg_name) { - const reg_entry *preg; + const reg_entry *prreg; - preg = (const reg_entry *) hash_find (preg_hash, preg_name); + prreg = (const reg_entry *) hash_find (preg_hash, preg_name); - if (preg != NULL) - return preg->value.preg_val; + if (prreg != NULL) + return prreg->value.preg_val; return nullpregister; } @@ -407,12 +407,12 @@ get_pregister (char *preg_name) static preg get_pregisterp (char *preg_name) { - const reg_entry *preg; + const reg_entry *prreg; - preg = (const reg_entry *) hash_find (pregp_hash, preg_name); + prreg = (const reg_entry *) hash_find (pregp_hash, preg_name); - if (preg != NULL) - return preg->value.preg_val; + if (prreg != NULL) + return prreg->value.preg_val; return nullpregister; } @@ -797,20 +797,20 @@ initialise_reg_hash_table (struct hash_control ** hash_table, const reg_entry * register_table, const unsigned int num_entries) { - const reg_entry * reg; + const reg_entry * rreg; const char *hashret; if ((* hash_table = hash_new ()) == NULL) as_fatal (_("Virtual memory exhausted")); - for (reg = register_table; - reg < (register_table + num_entries); - reg++) + for (rreg = register_table; + rreg < (register_table + num_entries); + rreg++) { - hashret = hash_insert (* hash_table, reg->name, (char *) reg); + hashret = hash_insert (* hash_table, rreg->name, (char *) rreg); if (hashret) as_fatal (_("Internal Error: Can't hash %s: %s"), - reg->name, hashret); + rreg->name, hashret); } } @@ -1105,20 +1105,20 @@ process_label_constant (char *str, ins * cr16_ins) static int getreg_image (reg r) { - const reg_entry *reg; + const reg_entry *rreg; char *reg_name; int is_procreg = 0; /* Nonzero means argument should be processor reg. */ /* Check whether the register is in registers table. */ if (r < MAX_REG) - reg = cr16_regtab + r; + rreg = cr16_regtab + r; else /* Register not found. */ { as_bad (_("Unknown register: `%d'"), r); return 0; } - reg_name = reg->name; + reg_name = rreg->name; /* Issue a error message when register is illegal. */ #define IMAGE_ERR \ @@ -1126,16 +1126,16 @@ getreg_image (reg r) reg_name, ins_parse); \ break; - switch (reg->type) + switch (rreg->type) { case CR16_R_REGTYPE: if (! is_procreg) - return reg->image; + return rreg->image; else IMAGE_ERR; case CR16_P_REGTYPE: - return reg->image; + return rreg->image; break; default: @@ -1579,12 +1579,12 @@ check_cinv_options (char * operand) static int getregp_image (reg r) { - const reg_entry *reg; + const reg_entry *rreg; char *reg_name; /* Check whether the register is in registers table. */ if (r < MAX_REG) - reg = cr16_regptab + r; + rreg = cr16_regptab + r; /* Register not found. */ else { @@ -1592,7 +1592,7 @@ getregp_image (reg r) return 0; } - reg_name = reg->name; + reg_name = rreg->name; /* Issue a error message when register pair is illegal. */ #define RPAIR_IMAGE_ERR \ @@ -1600,10 +1600,10 @@ getregp_image (reg r) reg_name, ins_parse); \ break; - switch (reg->type) + switch (rreg->type) { case CR16_RP_REGTYPE: - return reg->image; + return rreg->image; default: RPAIR_IMAGE_ERR; } @@ -1618,12 +1618,12 @@ getregp_image (reg r) static int getidxregp_image (reg r) { - const reg_entry *reg; + const reg_entry *rreg; char *reg_name; /* Check whether the register is in registers table. */ if (r < MAX_REG) - reg = cr16_regptab + r; + rreg = cr16_regptab + r; /* Register not found. */ else { @@ -1631,16 +1631,16 @@ getidxregp_image (reg r) return 0; } - reg_name = reg->name; + reg_name = rreg->name; /* Issue a error message when register pair is illegal. */ #define IDX_RPAIR_IMAGE_ERR \ as_bad (_("Illegal index register pair (`%s') in Instruction: `%s'"), \ reg_name, ins_parse); \ - if (reg->type == CR16_RP_REGTYPE) + if (rreg->type == CR16_RP_REGTYPE) { - switch (reg->image) + switch (rreg->image) { case 0: return 0; break; case 2: return 1; break; @@ -1665,12 +1665,12 @@ getidxregp_image (reg r) static int getprocreg_image (reg r) { - const reg_entry *reg; + const reg_entry *rreg; char *reg_name; /* Check whether the register is in registers table. */ if (r < MAX_PREG) - reg = &cr16_pregtab[r - MAX_REG]; + rreg = &cr16_pregtab[r - MAX_REG]; /* Register not found. */ else { @@ -1678,7 +1678,7 @@ getprocreg_image (reg r) return 0; } - reg_name = reg->name; + reg_name = rreg->name; /* Issue a error message when register pair is illegal. */ #define PROCREG_IMAGE_ERR \ @@ -1686,10 +1686,10 @@ getprocreg_image (reg r) reg_name, ins_parse); \ break; - switch (reg->type) + switch (rreg->type) { case CR16_P_REGTYPE: - return reg->image; + return rreg->image; default: PROCREG_IMAGE_ERR; } @@ -1703,7 +1703,7 @@ getprocreg_image (reg r) static int getprocregp_image (reg r) { - const reg_entry *reg; + const reg_entry *rreg; char *reg_name; int pregptab_disp = 0; @@ -1725,7 +1725,7 @@ getprocregp_image (reg r) pregptab_disp = 5; break; default: break; } - reg = &cr16_pregptab[r - pregptab_disp]; + rreg = &cr16_pregptab[r - pregptab_disp]; } /* Register not found. */ else @@ -1734,7 +1734,7 @@ getprocregp_image (reg r) return 0; } - reg_name = reg->name; + reg_name = rreg->name; /* Issue a error message when register pair is illegal. */ #define PROCREGP_IMAGE_ERR \ @@ -1742,10 +1742,10 @@ getprocregp_image (reg r) reg_name, ins_parse); \ break; - switch (reg->type) + switch (rreg->type) { case CR16_P_REGTYPE: - return reg->image; + return rreg->image; default: PROCREGP_IMAGE_ERR; } diff --git a/gas/config/tc-crx.c b/gas/config/tc-crx.c index e95aa05..fd93f41 100644 --- a/gas/config/tc-crx.c +++ b/gas/config/tc-crx.c @@ -205,12 +205,12 @@ get_opflags (operand_type op) static reg get_register (char *reg_name) { - const reg_entry *reg; + const reg_entry *rreg; - reg = (const reg_entry *) hash_find (reg_hash, reg_name); + rreg = (const reg_entry *) hash_find (reg_hash, reg_name); - if (reg != NULL) - return reg->value.reg_val; + if (rreg != NULL) + return rreg->value.reg_val; else return nullregister; } @@ -220,12 +220,12 @@ get_register (char *reg_name) static copreg get_copregister (char *copreg_name) { - const reg_entry *copreg; + const reg_entry *coreg; - copreg = (const reg_entry *) hash_find (copreg_hash, copreg_name); + coreg = (const reg_entry *) hash_find (copreg_hash, copreg_name); - if (copreg != NULL) - return copreg->value.copreg_val; + if (coreg != NULL) + return coreg->value.copreg_val; else return nullcopregister; } @@ -1106,7 +1106,7 @@ get_cinv_parameters (char * operand) static int getreg_image (reg r) { - const reg_entry *reg; + const reg_entry *rreg; char *reg_name; int is_procreg = 0; /* Nonzero means argument should be processor reg. */ @@ -1116,10 +1116,10 @@ getreg_image (reg r) /* Check whether the register is in registers table. */ if (r < MAX_REG) - reg = &crx_regtab[r]; + rreg = &crx_regtab[r]; /* Check whether the register is in coprocessor registers table. */ else if (r < MAX_COPREG) - reg = &crx_copregtab[r-MAX_REG]; + rreg = &crx_copregtab[r-MAX_REG]; /* Register not found. */ else { @@ -1127,7 +1127,7 @@ getreg_image (reg r) return 0; } - reg_name = reg->name; + reg_name = rreg->name; /* Issue a error message when register is illegal. */ #define IMAGE_ERR \ @@ -1135,29 +1135,29 @@ getreg_image (reg r) reg_name, ins_parse); \ break; - switch (reg->type) + switch (rreg->type) { case CRX_U_REGTYPE: if (is_procreg || (instruction->flags & USER_REG)) - return reg->image; + return rreg->image; else IMAGE_ERR; case CRX_CFG_REGTYPE: if (is_procreg) - return reg->image; + return rreg->image; else IMAGE_ERR; case CRX_R_REGTYPE: if (! is_procreg) - return reg->image; + return rreg->image; else IMAGE_ERR; case CRX_C_REGTYPE: case CRX_CS_REGTYPE: - return reg->image; + return rreg->image; break; default: diff --git a/gas/config/tc-d10v.c b/gas/config/tc-d10v.c index 339eb74..d0c3129 100644 --- a/gas/config/tc-d10v.c +++ b/gas/config/tc-d10v.c @@ -1201,7 +1201,9 @@ find_opcode (struct d10v_opcode *opcode, expressionS myops[]) for (i = 0; opcode->operands[i + 1]; i++) { int bits = d10v_operands[next_opcode->operands[opnum]].bits; - int flags = d10v_operands[next_opcode->operands[opnum]].flags; + + flags = d10v_operands[next_opcode->operands[opnum]].flags; + if (flags & OPERAND_ADDR) bits += 2; diff --git a/gas/config/tc-d30v.c b/gas/config/tc-d30v.c index 8d90d46..1874147 100644 --- a/gas/config/tc-d30v.c +++ b/gas/config/tc-d30v.c @@ -1133,7 +1133,7 @@ find_format (struct d30v_opcode *opcode, int fsize, int cmp_hack) { - int numops, match, index, i = 0, j, k; + int numops, match, opcode_index, i = 0, j, k; struct d30v_format *fm; if (opcode == NULL) @@ -1142,17 +1142,17 @@ find_format (struct d30v_opcode *opcode, /* Get all the operands and save them as expressions. */ numops = get_operands (myops, cmp_hack); - while ((index = opcode->format[i++]) != 0) + while ((opcode_index = opcode->format[i++]) != 0) { - if (fsize == FORCE_SHORT && index >= LONG) + if (fsize == FORCE_SHORT && opcode_index >= LONG) continue; - if (fsize == FORCE_LONG && index < LONG) + if (fsize == FORCE_LONG && opcode_index < LONG) continue; - fm = (struct d30v_format *) &d30v_format_table[index]; - k = index; - while (fm->form == index) + fm = (struct d30v_format *) &d30v_format_table[opcode_index]; + k = opcode_index; + while (fm->form == opcode_index) { match = 1; /* Now check the operands for compatibility. */ @@ -1346,13 +1346,14 @@ do_assemble (char *str, if (!strncmp (name, "cmp", 3)) { int p, i; - char **str = (char **) d30v_cc_names; + char **d30v_str = (char **) d30v_cc_names; + if (name[3] == 'u') p = 4; else p = 3; - for (i = 1; *str && strncmp (*str, &name[p], 2); i++, str++) + for (i = 1; *d30v_str && strncmp (*d30v_str, &name[p], 2); i++, d30v_str++) ; /* cmpu only supports some condition codes. */ @@ -1365,7 +1366,7 @@ do_assemble (char *str, } } - if (!*str) + if (!*d30v_str) { name[p + 2] = 0; as_bad (_("unknown condition code: %s"), &name[p]); diff --git a/gas/config/tc-frv.c b/gas/config/tc-frv.c index e29810c..9cdbe26 100644 --- a/gas/config/tc-frv.c +++ b/gas/config/tc-frv.c @@ -897,9 +897,7 @@ workaround_top: if (vliw1->insn_count == 2) { - struct vliw_insn_list *this_insn; - - /* check vliw1 for a label. */ + /* Check vliw1 for a label. */ for (this_insn = vliw1->insn_list; this_insn; this_insn = this_insn->next) { if (this_insn->type == VLIW_LABEL_TYPE) @@ -1041,9 +1039,9 @@ fr550_check_insn_acc_range (frv_insn *insn, int low, int hi) } static int -fr550_check_acc_range (FRV_VLIW *vliw, frv_insn *insn) +fr550_check_acc_range (FRV_VLIW *vlw, frv_insn *insn) { - switch ((*vliw->current_vliw)[vliw->next_slot - 1]) + switch ((*vlw->current_vliw)[vlw->next_slot - 1]) { case UNIT_FM0: case UNIT_FM2: diff --git a/gas/config/tc-i370.c b/gas/config/tc-i370.c index 3c7b140..c3c97fc 100644 --- a/gas/config/tc-i370.c +++ b/gas/config/tc-i370.c @@ -900,6 +900,7 @@ i370_dc (int unused ATTRIBUTE_UNUSED) int nbytes=0; expressionS exp; char type=0; + char * clse; if (is_it_end_of_statement ()) { @@ -929,24 +930,20 @@ i370_dc (int unused ATTRIBUTE_UNUSED) /* Get rid of pesky quotes. */ if ('\'' == *input_line_pointer) { - char * close; - ++input_line_pointer; - close = strchr (input_line_pointer, '\''); - if (close) - *close= ' '; + clse = strchr (input_line_pointer, '\''); + if (clse) + *clse= ' '; else as_bad (_("missing end-quote")); } if ('\"' == *input_line_pointer) { - char * close; - ++input_line_pointer; - close = strchr (input_line_pointer, '\"'); - if (close) - *close= ' '; + clse = strchr (input_line_pointer, '\"'); + if (clse) + *clse= ' '; else as_bad (_("missing end-quote")); } @@ -1523,21 +1520,23 @@ i370_addr_cons (expressionS *exp) /* Get rid of pesky quotes. */ if ('\'' == *input_line_pointer) { - char * close; + char * clse; + ++input_line_pointer; - close = strchr (input_line_pointer, '\''); - if (close) - *close= ' '; + clse = strchr (input_line_pointer, '\''); + if (clse) + *clse= ' '; else as_bad (_("missing end-quote")); } if ('\"' == *input_line_pointer) { - char * close; + char * clse; + ++input_line_pointer; - close = strchr (input_line_pointer, '\"'); - if (close) - *close= ' '; + clse = strchr (input_line_pointer, '\"'); + if (clse) + *clse= ' '; else as_bad (_("missing end-quote")); } diff --git a/gas/config/tc-i386-intel.c b/gas/config/tc-i386-intel.c index df749b8..b3cdcd3 100644 --- a/gas/config/tc-i386-intel.c +++ b/gas/config/tc-i386-intel.c @@ -154,7 +154,7 @@ operatorT i386_operator (const char *name, unsigned int operands, char *pc) } for (j = 0; i386_operators[j].name; ++j) - if (strcasecmp(i386_operators[j].name, name) == 0) + if (strcasecmp (i386_operators[j].name, name) == 0) { if (i386_operators[j].operands && i386_operators[j].operands != operands) @@ -163,16 +163,16 @@ operatorT i386_operator (const char *name, unsigned int operands, char *pc) } for (j = 0; i386_types[j].name; ++j) - if (strcasecmp(i386_types[j].name, name) == 0) + if (strcasecmp (i386_types[j].name, name) == 0) break; if (i386_types[j].name && *pc == ' ') { - char *name = ++input_line_pointer; + char *pname = ++input_line_pointer; char c = get_symbol_end (); - if (strcasecmp (name, "ptr") == 0) + if (strcasecmp (pname, "ptr") == 0) { - name[-1] = *pc; + pname[-1] = *pc; *pc = c; if (intel_syntax > 0 || operands != 1) return O_illegal; @@ -180,7 +180,7 @@ operatorT i386_operator (const char *name, unsigned int operands, char *pc) } *input_line_pointer = c; - input_line_pointer = name - 1; + input_line_pointer = pname - 1; } return O_absent; @@ -188,13 +188,13 @@ operatorT i386_operator (const char *name, unsigned int operands, char *pc) static int i386_intel_parse_name (const char *name, expressionS *e) { - unsigned int i; + unsigned int j; - for (i = 0; i386_types[i].name; ++i) - if (strcasecmp(i386_types[i].name, name) == 0) + for (j = 0; i386_types[j].name; ++j) + if (strcasecmp(i386_types[j].name, name) == 0) { e->X_op = O_constant; - e->X_add_number = i386_types[i].sz[flag_code]; + e->X_add_number = i386_types[j].sz[flag_code]; e->X_add_symbol = NULL; e->X_op_symbol = NULL; return 1; @@ -203,12 +203,12 @@ static int i386_intel_parse_name (const char *name, expressionS *e) return 0; } -static INLINE int i386_intel_check (const reg_entry *reg, +static INLINE int i386_intel_check (const reg_entry *rreg, const reg_entry *base, - const reg_entry *index) + const reg_entry *iindex) { - if ((this_operand >= 0 && reg != i.op[this_operand].regs) - || base != intel_state.base || index != intel_state.index) + if ((this_operand >= 0 && rreg != i.op[this_operand].regs) + || base != intel_state.base || iindex != intel_state.index) { as_bad (_("invalid use of register")); return 0; @@ -249,9 +249,9 @@ static INLINE int i386_intel_simplify_symbol(symbolS *sym) static int i386_intel_simplify (expressionS *e) { - const reg_entry *reg = this_operand >= 0 ? i.op[this_operand].regs : NULL; + const reg_entry *the_reg = this_operand >= 0 ? i.op[this_operand].regs : NULL; const reg_entry *base = intel_state.base; - const reg_entry *index = intel_state.index; + const reg_entry *state_index = intel_state.index; int ret; if (!intel_syntax) @@ -263,7 +263,7 @@ static int i386_intel_simplify (expressionS *e) if (e->X_add_symbol) { if (!i386_intel_simplify_symbol (e->X_add_symbol) - || !i386_intel_check(reg, intel_state.base, intel_state.index)) + || !i386_intel_check(the_reg, intel_state.base, intel_state.index)) return 0;; } if (!intel_state.in_offset) @@ -284,7 +284,7 @@ static int i386_intel_simplify (expressionS *e) ++intel_state.in_offset; ret = i386_intel_simplify_symbol (e->X_add_symbol); --intel_state.in_offset; - if (!ret || !i386_intel_check(reg, base, index)) + if (!ret || !i386_intel_check(the_reg, base, state_index)) return 0; i386_intel_fold (e, e->X_add_symbol); return ret; @@ -321,7 +321,7 @@ static int i386_intel_simplify (expressionS *e) return 0; } if (!i386_intel_simplify_symbol (e->X_op_symbol) - || !i386_intel_check(reg, intel_state.base, intel_state.index)) + || !i386_intel_check(the_reg, intel_state.base, intel_state.index)) return 0; if (!intel_state.in_offset) intel_state.seg = e->X_add_symbol; @@ -425,13 +425,13 @@ static int i386_intel_simplify (expressionS *e) if (e->X_op == O_add || e->X_op == O_subtract) { base = intel_state.base; - index = intel_state.index; + state_index = intel_state.index; } - if (!i386_intel_check (reg, base, index) + if (!i386_intel_check (the_reg, base, state_index) || (e->X_op_symbol && !i386_intel_simplify_symbol (e->X_op_symbol)) - || !i386_intel_check (reg, + || !i386_intel_check (the_reg, e->X_op != O_add ? base : intel_state.base, - e->X_op != O_add ? index : intel_state.index)) + e->X_op != O_add ? state_index : intel_state.index)) return 0; break; } diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 0dc1c57..efdd8c2 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2023,20 +2023,20 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED) { char *string = input_line_pointer; int e = get_symbol_end (); - unsigned int i; + unsigned int j; i386_cpu_flags flags; - for (i = 0; i < ARRAY_SIZE (cpu_arch); i++) + for (j = 0; j < ARRAY_SIZE (cpu_arch); j++) { - if (strcmp (string, cpu_arch[i].name) == 0) + if (strcmp (string, cpu_arch[j].name) == 0) { - check_cpu_arch_compatible (string, cpu_arch[i].flags); + check_cpu_arch_compatible (string, cpu_arch[j].flags); if (*string != '.') { - cpu_arch_name = cpu_arch[i].name; + cpu_arch_name = cpu_arch[j].name; cpu_sub_arch_name = NULL; - cpu_arch_flags = cpu_arch[i].flags; + cpu_arch_flags = cpu_arch[j].flags; if (flag_code == CODE_64BIT) { cpu_arch_flags.bitfield.cpu64 = 1; @@ -2047,8 +2047,8 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED) cpu_arch_flags.bitfield.cpu64 = 0; cpu_arch_flags.bitfield.cpuno64 = 1; } - cpu_arch_isa = cpu_arch[i].type; - cpu_arch_isa_flags = cpu_arch[i].flags; + cpu_arch_isa = cpu_arch[j].type; + cpu_arch_isa_flags = cpu_arch[j].flags; if (!cpu_arch_tune_set) { cpu_arch_tune = cpu_arch_isa; @@ -2059,22 +2059,22 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED) if (strncmp (string + 1, "no", 2)) flags = cpu_flags_or (cpu_arch_flags, - cpu_arch[i].flags); + cpu_arch[j].flags); else flags = cpu_flags_and_not (cpu_arch_flags, - cpu_arch[i].flags); + cpu_arch[j].flags); if (!cpu_flags_equal (&flags, &cpu_arch_flags)) { if (cpu_sub_arch_name) { char *name = cpu_sub_arch_name; cpu_sub_arch_name = concat (name, - cpu_arch[i].name, + cpu_arch[j].name, (const char *) NULL); free (name); } else - cpu_sub_arch_name = xstrdup (cpu_arch[i].name); + cpu_sub_arch_name = xstrdup (cpu_arch[j].name); cpu_arch_flags = flags; } *input_line_pointer = e; @@ -2082,7 +2082,7 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED) return; } } - if (i >= ARRAY_SIZE (cpu_arch)) + if (j >= ARRAY_SIZE (cpu_arch)) as_bad (_("no such architecture: `%s'"), string); *input_line_pointer = e; @@ -2454,7 +2454,7 @@ reloc (unsigned int size, { if (other != NO_RELOC) { - reloc_howto_type *reloc; + reloc_howto_type *rel; if (size == 8) switch (other) @@ -2485,18 +2485,18 @@ reloc (unsigned int size, if (size == 4 && flag_code != CODE_64BIT) sign = -1; - reloc = bfd_reloc_type_lookup (stdoutput, other); - if (!reloc) + rel = bfd_reloc_type_lookup (stdoutput, other); + if (!rel) as_bad (_("unknown relocation (%u)"), other); - else if (size != bfd_get_reloc_size (reloc)) + else if (size != bfd_get_reloc_size (rel)) as_bad (_("%u-byte relocation cannot be applied to %u-byte field"), - bfd_get_reloc_size (reloc), + bfd_get_reloc_size (rel), size); - else if (pcrel && !reloc->pc_relative) + else if (pcrel && !rel->pc_relative) as_bad (_("non-pc-relative relocation for pc-relative field")); - else if ((reloc->complain_on_overflow == complain_overflow_signed + else if ((rel->complain_on_overflow == complain_overflow_signed && !sign) - || (reloc->complain_on_overflow == complain_overflow_unsigned + || (rel->complain_on_overflow == complain_overflow_unsigned && sign > 0)) as_bad (_("relocated field and relocation type differ in signedness")); else @@ -3639,28 +3639,28 @@ optimize_disp (void) { if (i.op[op].disps->X_op == O_constant) { - offsetT disp = i.op[op].disps->X_add_number; + offsetT op_disp = i.op[op].disps->X_add_number; if (i.types[op].bitfield.disp16 - && (disp & ~(offsetT) 0xffff) == 0) + && (op_disp & ~(offsetT) 0xffff) == 0) { /* If this operand is at most 16 bits, convert to a signed 16 bit number and don't use 64bit displacement. */ - disp = (((disp & 0xffff) ^ 0x8000) - 0x8000); + op_disp = (((op_disp & 0xffff) ^ 0x8000) - 0x8000); i.types[op].bitfield.disp64 = 0; } if (i.types[op].bitfield.disp32 - && (disp & ~(((offsetT) 2 << 31) - 1)) == 0) + && (op_disp & ~(((offsetT) 2 << 31) - 1)) == 0) { /* If this operand is at most 32 bits, convert to a signed 32 bit number and don't use 64bit displacement. */ - disp &= (((offsetT) 2 << 31) - 1); - disp = (disp ^ ((offsetT) 1 << 31)) - ((addressT) 1 << 31); + op_disp &= (((offsetT) 2 << 31) - 1); + op_disp = (op_disp ^ ((offsetT) 1 << 31)) - ((addressT) 1 << 31); i.types[op].bitfield.disp64 = 0; } - if (!disp && i.types[op].bitfield.baseindex) + if (!op_disp && i.types[op].bitfield.baseindex) { i.types[op].bitfield.disp8 = 0; i.types[op].bitfield.disp16 = 0; @@ -3672,19 +3672,19 @@ optimize_disp (void) } else if (flag_code == CODE_64BIT) { - if (fits_in_signed_long (disp)) + if (fits_in_signed_long (op_disp)) { i.types[op].bitfield.disp64 = 0; i.types[op].bitfield.disp32s = 1; } if (i.prefix[ADDR_PREFIX] - && fits_in_unsigned_long (disp)) + && fits_in_unsigned_long (op_disp)) i.types[op].bitfield.disp32 = 1; } if ((i.types[op].bitfield.disp32 || i.types[op].bitfield.disp32s || i.types[op].bitfield.disp16) - && fits_in_signed_byte (disp)) + && fits_in_signed_byte (op_disp)) i.types[op].bitfield.disp8 = 1; } else if (i.reloc[op] == BFD_RELOC_386_TLS_DESC_CALL @@ -4683,13 +4683,14 @@ finalize_imm (void) static int bad_implicit_operand (int xmm) { - const char *reg = xmm ? "xmm0" : "ymm0"; + const char *ireg = xmm ? "xmm0" : "ymm0"; + if (intel_syntax) as_bad (_("the last operand of `%s' must be `%s%s'"), - i.tm.name, register_prefix, reg); + i.tm.name, register_prefix, ireg); else as_bad (_("the first operand of `%s' must be `%s%s'"), - i.tm.name, register_prefix, reg); + i.tm.name, register_prefix, ireg); return 0; } @@ -4705,13 +4706,13 @@ process_operands (void) && (i.tm.opcode_modifier.vexnds || i.tm.opcode_modifier.vexndd)) { - unsigned int dup = i.operands; - unsigned int dest = dup - 1; + unsigned int dupl = i.operands; + unsigned int dest = dupl - 1; unsigned int j; /* The destination must be an xmm register. */ gas_assert (i.reg_operands - && MAX_OPERANDS > dup + && MAX_OPERANDS > dupl && operand_type_equal (&i.types[dest], ®xmm)); if (i.tm.opcode_modifier.firstxmm0) @@ -4742,7 +4743,7 @@ process_operands (void) } else if (i.tm.opcode_modifier.implicit1stxmm0) { - gas_assert ((MAX_OPERANDS - 1) > dup + gas_assert ((MAX_OPERANDS - 1) > dupl && i.tm.opcode_modifier.vex3sources); /* Add the implicit xmm0 for instructions with VEX prefix @@ -4762,11 +4763,11 @@ process_operands (void) i.reg_operands += 2; i.tm.operands += 2; - dup++; + dupl++; dest++; - i.op[dup] = i.op[dest]; - i.types[dup] = i.types[dest]; - i.tm.operand_types[dup] = i.tm.operand_types[dest]; + i.op[dupl] = i.op[dest]; + i.types[dupl] = i.types[dest]; + i.tm.operand_types[dupl] = i.tm.operand_types[dest]; } else { @@ -4775,9 +4776,9 @@ duplicate: i.reg_operands++; i.tm.operands++; - i.op[dup] = i.op[dest]; - i.types[dup] = i.types[dest]; - i.tm.operand_types[dup] = i.tm.operand_types[dest]; + i.op[dupl] = i.op[dest]; + i.types[dupl] = i.types[dest]; + i.tm.operand_types[dupl] = i.tm.operand_types[dest]; } if (i.tm.opcode_modifier.immext) @@ -4929,7 +4930,7 @@ build_modrm_byte (void) vex_2_sources = i.tm.opcode_modifier.vex2sources; if (vex_3_sources) { - unsigned int nds, reg; + unsigned int nds, reg_slot; expressionS *exp; if (i.tm.opcode_modifier.veximmext @@ -4939,7 +4940,7 @@ build_modrm_byte (void) gas_assert (dest == 3); } else - dest = i.operands - 1; + dest = i.operands - 1; nds = dest - 1; /* This instruction must have 4 register operands @@ -4963,23 +4964,23 @@ build_modrm_byte (void) if (i.tm.opcode_modifier.vexw1) { source = 0; - reg = 1; + reg_slot = 1; } else { source = 1; - reg = 0; + reg_slot = 0; } - gas_assert ((operand_type_equal (&i.tm.operand_types[reg], ®xmm) - || operand_type_equal (&i.tm.operand_types[reg], + gas_assert ((operand_type_equal (&i.tm.operand_types[reg_slot], ®xmm) + || operand_type_equal (&i.tm.operand_types[reg_slot], ®ymm)) && (operand_type_equal (&i.tm.operand_types[nds], ®xmm) || operand_type_equal (&i.tm.operand_types[nds], ®ymm))); exp->X_op = O_constant; exp->X_add_number - = ((i.op[reg].regs->reg_num - + ((i.op[reg].regs->reg_flags & RegRex) ? 8 : 0)) << 4); + = ((i.op[reg_slot].regs->reg_num + + ((i.op[reg_slot].regs->reg_flags & RegRex) ? 8 : 0)) << 4); i.vex.register_specifier = i.op[nds].regs; } else @@ -6110,7 +6111,7 @@ x86_cons_fix_new (fragS *frag, unsigned int off, unsigned int len, is non-null set it to the length of the string we removed from the input line. Otherwise return NULL. */ static char * -lex_got (enum bfd_reloc_code_real *reloc, +lex_got (enum bfd_reloc_code_real *rel, int *adjust, i386_operand_type *types) { @@ -6199,7 +6200,7 @@ lex_got (enum bfd_reloc_code_real *reloc, int first, second; char *tmpbuf, *past_reloc; - *reloc = gotrel[j].rel[object_64bit]; + *rel = gotrel[j].rel[object_64bit]; if (adjust) *adjust = len; @@ -7877,7 +7878,7 @@ size_t md_longopts_size = sizeof (md_longopts); int md_parse_option (int c, char *arg) { - unsigned int i; + unsigned int j; char *arch, *next; switch (c) @@ -7963,16 +7964,16 @@ md_parse_option (int c, char *arg) next = strchr (arch, '+'); if (next) *next++ = '\0'; - for (i = 0; i < ARRAY_SIZE (cpu_arch); i++) + for (j = 0; j < ARRAY_SIZE (cpu_arch); j++) { - if (strcmp (arch, cpu_arch [i].name) == 0) + if (strcmp (arch, cpu_arch [j].name) == 0) { /* Processor. */ - cpu_arch_name = cpu_arch[i].name; + cpu_arch_name = cpu_arch[j].name; cpu_sub_arch_name = NULL; - cpu_arch_flags = cpu_arch[i].flags; - cpu_arch_isa = cpu_arch[i].type; - cpu_arch_isa_flags = cpu_arch[i].flags; + cpu_arch_flags = cpu_arch[j].flags; + cpu_arch_isa = cpu_arch[j].type; + cpu_arch_isa_flags = cpu_arch[j].flags; if (!cpu_arch_tune_set) { cpu_arch_tune = cpu_arch_isa; @@ -7980,37 +7981,37 @@ md_parse_option (int c, char *arg) } break; } - else if (*cpu_arch [i].name == '.' - && strcmp (arch, cpu_arch [i].name + 1) == 0) + else if (*cpu_arch [j].name == '.' + && strcmp (arch, cpu_arch [j].name + 1) == 0) { /* ISA entension. */ i386_cpu_flags flags; if (strncmp (arch, "no", 2)) flags = cpu_flags_or (cpu_arch_flags, - cpu_arch[i].flags); + cpu_arch[j].flags); else flags = cpu_flags_and_not (cpu_arch_flags, - cpu_arch[i].flags); + cpu_arch[j].flags); if (!cpu_flags_equal (&flags, &cpu_arch_flags)) { if (cpu_sub_arch_name) { char *name = cpu_sub_arch_name; cpu_sub_arch_name = concat (name, - cpu_arch[i].name, + cpu_arch[j].name, (const char *) NULL); free (name); } else - cpu_sub_arch_name = xstrdup (cpu_arch[i].name); + cpu_sub_arch_name = xstrdup (cpu_arch[j].name); cpu_arch_flags = flags; } break; } } - if (i >= ARRAY_SIZE (cpu_arch)) + if (j >= ARRAY_SIZE (cpu_arch)) as_fatal (_("Invalid -march= option: `%s'"), arg); arch = next; @@ -8021,17 +8022,17 @@ md_parse_option (int c, char *arg) case OPTION_MTUNE: if (*arg == '.') as_fatal (_("Invalid -mtune= option: `%s'"), arg); - for (i = 0; i < ARRAY_SIZE (cpu_arch); i++) + for (j = 0; j < ARRAY_SIZE (cpu_arch); j++) { - if (strcmp (arg, cpu_arch [i].name) == 0) + if (strcmp (arg, cpu_arch [j].name) == 0) { cpu_arch_tune_set = 1; - cpu_arch_tune = cpu_arch [i].type; - cpu_arch_tune_flags = cpu_arch[i].flags; + cpu_arch_tune = cpu_arch [j].type; + cpu_arch_tune_flags = cpu_arch[j].flags; break; } } - if (i >= ARRAY_SIZE (cpu_arch)) + if (j >= ARRAY_SIZE (cpu_arch)) as_fatal (_("Invalid -mtune= option: `%s'"), arg); break; @@ -8713,12 +8714,12 @@ i386_solaris_fix_up_eh_frame (segT sec) void tc_pe_dwarf2_emit_offset (symbolS *symbol, unsigned int size) { - expressionS expr; + expressionS exp; - expr.X_op = O_secrel; - expr.X_add_symbol = symbol; - expr.X_add_number = 0; - emit_expr (&expr, size); + exp.X_op = O_secrel; + exp.X_add_symbol = symbol; + exp.X_add_number = 0; + emit_expr (&exp, size); } #endif diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index e3369df..dcaa416 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -2547,7 +2547,7 @@ slot_index (unsigned long slot_addr, fragS *first_frag, int before_relax) { - unsigned long index = 0; + unsigned long s_index = 0; /* First time we are called, the initial address and frag are invalid. */ if (first_addr == 0) @@ -2565,7 +2565,7 @@ slot_index (unsigned long slot_addr, /* We can get the final addresses only during and after relaxation. */ if (first_frag->fr_next && first_frag->fr_next->fr_address) - index += 3 * ((first_frag->fr_next->fr_address + s_index += 3 * ((first_frag->fr_next->fr_address - first_frag->fr_address - first_frag->fr_fix) >> 4); } @@ -2586,7 +2586,7 @@ slot_index (unsigned long slot_addr, case rs_align_test: /* Take alignment into account. Assume the worst case before relaxation. */ - index += 3 * ((1 << first_frag->fr_offset) >> 4); + s_index += 3 * ((1 << first_frag->fr_offset) >> 4); break; case rs_org: @@ -2596,14 +2596,14 @@ slot_index (unsigned long slot_addr, break; } case rs_fill: - index += 3 * (first_frag->fr_offset >> 4); + s_index += 3 * (first_frag->fr_offset >> 4); break; } /* Add in the full size of the frag converted to instruction slots. */ - index += 3 * (first_frag->fr_fix >> 4); + s_index += 3 * (first_frag->fr_fix >> 4); /* Subtract away the initial part before first_addr. */ - index -= (3 * ((first_addr >> 4) - (start_addr >> 4)) + s_index -= (3 * ((first_addr >> 4) - (start_addr >> 4)) + ((first_addr & 0x3) - (start_addr & 0x3))); /* Move to the beginning of the next frag. */ @@ -2619,9 +2619,9 @@ slot_index (unsigned long slot_addr, } /* Add in the used part of the last frag. */ - index += (3 * ((slot_addr >> 4) - (first_addr >> 4)) + s_index += (3 * ((slot_addr >> 4) - (first_addr >> 4)) + ((slot_addr & 0x3) - (first_addr & 0x3))); - return index; + return s_index; } /* Optimize unwind record directives. */ @@ -4646,7 +4646,7 @@ dot_ln (int dummy ATTRIBUTE_UNUSED) } static void -cross_section (int ref, void (*cons) (int), int ua) +cross_section (int ref, void (*builder) (int), int ua) { char *start, *end; int saved_auto_align; @@ -4691,15 +4691,15 @@ cross_section (int ref, void (*cons) (int), int ua) end = input_line_pointer + 1; /* skip comma */ input_line_pointer = start; md.keep_pending_output = 1; - section_count = bfd_count_sections(stdoutput); + section_count = bfd_count_sections (stdoutput); obj_elf_section (0); - if (section_count != bfd_count_sections(stdoutput)) + if (section_count != bfd_count_sections (stdoutput)) as_warn (_("Creating sections with .xdataN/.xrealN/.xstringZ is deprecated.")); input_line_pointer = end; saved_auto_align = md.auto_align; if (ua) md.auto_align = 0; - (*cons) (ref); + (*builder) (ref); if (ua) md.auto_align = saved_auto_align; obj_elf_previous (0); @@ -5305,9 +5305,9 @@ operand_width (enum ia64_opnd opnd) } static enum operand_match_result -operand_match (const struct ia64_opcode *idesc, int index, expressionS *e) +operand_match (const struct ia64_opcode *idesc, int res_index, expressionS *e) { - enum ia64_opnd opnd = idesc->operands[index]; + enum ia64_opnd opnd = idesc->operands[res_index]; int bits, relocatable = 0; struct insn_fix *fix; bfd_signed_vma val; @@ -5477,7 +5477,7 @@ operand_match (const struct ia64_opcode *idesc, int index, expressionS *e) case IA64_OPND_CNT2a: case IA64_OPND_LEN4: case IA64_OPND_LEN6: - bits = operand_width (idesc->operands[index]); + bits = operand_width (idesc->operands[res_index]); if (e->X_op == O_constant) { if ((bfd_vma) (e->X_add_number - 1) < ((bfd_vma) 1 << bits)) @@ -5551,7 +5551,7 @@ operand_match (const struct ia64_opcode *idesc, int index, expressionS *e) e->X_op = O_symbol; } - fix->opnd = idesc->operands[index]; + fix->opnd = idesc->operands[res_index]; fix->expr = *e; fix->is_pcrel = 0; ++CURR_SLOT.num_fixups; @@ -5586,7 +5586,7 @@ operand_match (const struct ia64_opcode *idesc, int index, expressionS *e) case IA64_OPND_MBTYPE4: case IA64_OPND_MHTYPE8: case IA64_OPND_POS6: - bits = operand_width (idesc->operands[index]); + bits = operand_width (idesc->operands[res_index]); if (e->X_op == O_constant) { if ((bfd_vma) e->X_add_number < ((bfd_vma) 1 << bits)) @@ -5597,7 +5597,7 @@ operand_match (const struct ia64_opcode *idesc, int index, expressionS *e) break; case IA64_OPND_IMMU9: - bits = operand_width (idesc->operands[index]); + bits = operand_width (idesc->operands[res_index]); if (e->X_op == O_constant) { if ((bfd_vma) e->X_add_number < ((bfd_vma) 1 << bits)) @@ -5673,14 +5673,14 @@ operand_match (const struct ia64_opcode *idesc, int index, expressionS *e) case IA64_OPND_IMM8M1U8: case IA64_OPND_IMM9a: case IA64_OPND_IMM9b: - bits = operand_width (idesc->operands[index]); + bits = operand_width (idesc->operands[res_index]); if (relocatable && (e->X_op == O_symbol || e->X_op == O_subtract || e->X_op == O_pseudo_fixup)) { fix = CURR_SLOT.fixup + CURR_SLOT.num_fixups; - if (idesc->operands[index] == IA64_OPND_IMM14) + if (idesc->operands[res_index] == IA64_OPND_IMM14) fix->code = BFD_RELOC_IA64_IMM14; else fix->code = BFD_RELOC_IA64_IMM22; @@ -5692,7 +5692,7 @@ operand_match (const struct ia64_opcode *idesc, int index, expressionS *e) e->X_op = O_symbol; } - fix->opnd = idesc->operands[index]; + fix->opnd = idesc->operands[res_index]; fix->expr = *e; fix->is_pcrel = 0; ++CURR_SLOT.num_fixups; @@ -5798,7 +5798,7 @@ operand_match (const struct ia64_opcode *idesc, int index, expressionS *e) abort (); fix->code = ia64_gen_real_reloc_type (e->X_op_symbol, fix->code); - fix->opnd = idesc->operands[index]; + fix->opnd = idesc->operands[res_index]; fix->expr = *e; fix->is_pcrel = 1; ++CURR_SLOT.num_fixups; @@ -5817,7 +5817,7 @@ operand_match (const struct ia64_opcode *idesc, int index, expressionS *e) create a dummy reloc. This will not live past md_apply_fix. */ fix->code = BFD_RELOC_UNUSED; fix->code = ia64_gen_real_reloc_type (e->X_op_symbol, fix->code); - fix->opnd = idesc->operands[index]; + fix->opnd = idesc->operands[res_index]; fix->expr = *e; fix->is_pcrel = 1; ++CURR_SLOT.num_fixups; @@ -5831,7 +5831,7 @@ operand_match (const struct ia64_opcode *idesc, int index, expressionS *e) case IA64_OPND_LDXMOV: fix = CURR_SLOT.fixup + CURR_SLOT.num_fixups; fix->code = BFD_RELOC_IA64_LDXMOV; - fix->opnd = idesc->operands[index]; + fix->opnd = idesc->operands[res_index]; fix->expr = *e; fix->is_pcrel = 0; ++CURR_SLOT.num_fixups; @@ -8361,9 +8361,9 @@ dep->name, idesc->name, (rsrc_write?"write":"read"), note) || (!rsrc_write && idesc->operands[1] == IA64_OPND_PMD_R3)) { - int index = ((idesc->operands[1] == IA64_OPND_R3 && !rsrc_write) - ? 1 : !rsrc_write); - int regno = CURR_SLOT.opnd[index].X_add_number - REG_GR; + int reg_index = ((idesc->operands[1] == IA64_OPND_R3 && !rsrc_write) + ? 1 : !rsrc_write); + int regno = CURR_SLOT.opnd[reg_index].X_add_number - REG_GR; if (regno >= 0 && regno < NELEMS (gr_values) && KNOWN (regno)) { @@ -8901,11 +8901,11 @@ dep->name, idesc->name, (rsrc_write?"write":"read"), note) if (idesc->operands[0] == IA64_OPND_CR3 || idesc->operands[1] == IA64_OPND_CR3) { - int index = + int reg_index = ((idesc->operands[0] == IA64_OPND_CR3) ? 0 : 1); int regno = - CURR_SLOT.opnd[index].X_add_number - REG_CR; + CURR_SLOT.opnd[reg_index].X_add_number - REG_CR; switch (regno) { @@ -8939,15 +8939,15 @@ dep->name, idesc->name, (rsrc_write?"write":"read"), note) if (idesc->operands[0] == IA64_OPND_AR3 || idesc->operands[1] == IA64_OPND_AR3) { - int index = + int reg_index = ((idesc->operands[0] == IA64_OPND_AR3) ? 0 : 1); int regno = - CURR_SLOT.opnd[index].X_add_number - REG_AR; + CURR_SLOT.opnd[reg_index].X_add_number - REG_AR; if (regno == AR_ITC || regno == AR_RUC - || (index == 0 + || (reg_index == 0 && (regno == AR_RSC || (regno >= AR_K0 && regno <= AR_K7)))) @@ -10799,13 +10799,13 @@ ia64_pcrel_from_section (fixS *fix, segT sec) void ia64_dwarf2_emit_offset (symbolS *symbol, unsigned int size) { - expressionS expr; + expressionS exp; - expr.X_op = O_pseudo_fixup; - expr.X_op_symbol = pseudo_func[FUNC_SEC_RELATIVE].u.sym; - expr.X_add_number = 0; - expr.X_add_symbol = symbol; - emit_expr (&expr, size); + exp.X_op = O_pseudo_fixup; + exp.X_op_symbol = pseudo_func[FUNC_SEC_RELATIVE].u.sym; + exp.X_add_number = 0; + exp.X_add_symbol = symbol; + emit_expr (&exp, size); } /* This is called whenever some data item (not an instruction) needs a @@ -11403,13 +11403,13 @@ ia64_handle_align (fragS *fragp) { int bytes; char *p; - const unsigned char *nop; + const unsigned char *nop_type; if (fragp->fr_type != rs_align_code) return; /* Check if this frag has to end with a stop bit. */ - nop = fragp->tc_frag_data ? le_nop_stop : le_nop; + nop_type = fragp->tc_frag_data ? le_nop_stop : le_nop; bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; p = fragp->fr_literal + fragp->fr_fix; @@ -11446,7 +11446,7 @@ ia64_handle_align (fragS *fragp) } /* Instruction bundles are always little-endian. */ - memcpy (p, nop, 16); + memcpy (p, nop_type, 16); fragp->fr_var = 16; } diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c index 0440448..dcde231 100644 --- a/gas/config/tc-m32r.c +++ b/gas/config/tc-m32r.c @@ -570,7 +570,7 @@ debug_sym (int ignore ATTRIBUTE_UNUSED) char delim; char *end_name; symbolS *symbolP; - sym_linkS *link; + sym_linkS *lnk; name = input_line_pointer; delim = get_symbol_end (); @@ -589,10 +589,10 @@ debug_sym (int ignore ATTRIBUTE_UNUSED) else { - link = (sym_linkS *) xmalloc (sizeof (sym_linkS)); - link->symbol = symbolP; - link->next = debug_sym_link; - debug_sym_link = link; + lnk = (sym_linkS *) xmalloc (sizeof (sym_linkS)); + lnk->symbol = symbolP; + lnk->next = debug_sym_link; + debug_sym_link = lnk; symbol_get_obj (symbolP)->local = 1; } diff --git a/gas/config/tc-m68hc11.c b/gas/config/tc-m68hc11.c index 81913ea..5cae36f 100644 --- a/gas/config/tc-m68hc11.c +++ b/gas/config/tc-m68hc11.c @@ -1612,7 +1612,7 @@ build_jump_insn (struct m68hc11_opcode *opcode, operand operands[], } else { - char *opcode; + char *op; frag = frag_now; where = frag_now_fix (); @@ -1623,8 +1623,8 @@ build_jump_insn (struct m68hc11_opcode *opcode, operand operands[], /* Branch offset must fit in 8-bits, don't do some relax. */ if (jmp_mode == 0 && flag_fixed_branches) { - opcode = m68hc11_new_insn (1); - number_to_chars_bigendian (opcode, code, 1); + op = m68hc11_new_insn (1); + number_to_chars_bigendian (op, code, 1); fixup8 (&operands[0].exp, M6811_OP_JUMP_REL, M6811_OP_JUMP_REL); } @@ -1632,31 +1632,31 @@ build_jump_insn (struct m68hc11_opcode *opcode, operand operands[], else if (code == M6811_BSR || code == M6811_BRA || code == M6812_BSR) { /* Allocate worst case storage. */ - opcode = m68hc11_new_insn (3); - number_to_chars_bigendian (opcode, code, 1); - number_to_chars_bigendian (opcode + 1, 0, 1); + op = m68hc11_new_insn (3); + number_to_chars_bigendian (op, code, 1); + number_to_chars_bigendian (op + 1, 0, 1); frag_variant (rs_machine_dependent, 1, 1, ENCODE_RELAX (STATE_PC_RELATIVE, STATE_UNDF), operands[0].exp.X_add_symbol, (offsetT) n, - opcode); + op); } else if (current_architecture & cpu6812) { - opcode = m68hc11_new_insn (2); - number_to_chars_bigendian (opcode, code, 1); - number_to_chars_bigendian (opcode + 1, 0, 1); + op = m68hc11_new_insn (2); + number_to_chars_bigendian (op, code, 1); + number_to_chars_bigendian (op + 1, 0, 1); frag_var (rs_machine_dependent, 2, 2, ENCODE_RELAX (STATE_CONDITIONAL_BRANCH_6812, STATE_UNDF), - operands[0].exp.X_add_symbol, (offsetT) n, opcode); + operands[0].exp.X_add_symbol, (offsetT) n, op); } else { - opcode = m68hc11_new_insn (2); - number_to_chars_bigendian (opcode, code, 1); - number_to_chars_bigendian (opcode + 1, 0, 1); + op = m68hc11_new_insn (2); + number_to_chars_bigendian (op, code, 1); + number_to_chars_bigendian (op + 1, 0, 1); frag_var (rs_machine_dependent, 3, 3, ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_UNDF), - operands[0].exp.X_add_symbol, (offsetT) n, opcode); + operands[0].exp.X_add_symbol, (offsetT) n, op); } } } diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 1c96480..ff2ffc6 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -2612,10 +2612,10 @@ insns_between (const struct mips_cl_insn *insn1, /* Return the number of nops that would be needed to work around the VR4130 mflo/mfhi errata if instruction INSN immediately followed - the MAX_VR4130_NOPS instructions described by HISTORY. */ + the MAX_VR4130_NOPS instructions described by HIST. */ static int -nops_for_vr4130 (const struct mips_cl_insn *history, +nops_for_vr4130 (const struct mips_cl_insn *hist, const struct mips_cl_insn *insn) { int i, j, reg; @@ -2630,13 +2630,13 @@ nops_for_vr4130 (const struct mips_cl_insn *history, /* Search for the first MFLO or MFHI. */ for (i = 0; i < MAX_VR4130_NOPS; i++) - if (MF_HILO_INSN (history[i].insn_mo->pinfo)) + if (MF_HILO_INSN (hist[i].insn_mo->pinfo)) { /* Extract the destination register. */ if (mips_opts.mips16) - reg = mips16_to_32_reg_map[MIPS16_EXTRACT_OPERAND (RX, history[i])]; + reg = mips16_to_32_reg_map[MIPS16_EXTRACT_OPERAND (RX, hist[i])]; else - reg = EXTRACT_OPERAND (RD, history[i]); + reg = EXTRACT_OPERAND (RD, hist[i]); /* No nops are needed if INSN reads that register. */ if (insn != NULL && insn_uses_reg (insn, reg, MIPS_GR_REG)) @@ -2644,7 +2644,7 @@ nops_for_vr4130 (const struct mips_cl_insn *history, /* ...or if any of the intervening instructions do. */ for (j = 0; j < i; j++) - if (insn_uses_reg (&history[j], reg, MIPS_GR_REG)) + if (insn_uses_reg (&hist[j], reg, MIPS_GR_REG)) return 0; return MAX_VR4130_NOPS - i; @@ -2653,12 +2653,12 @@ nops_for_vr4130 (const struct mips_cl_insn *history, } /* Return the number of nops that would be needed if instruction INSN - immediately followed the MAX_NOPS instructions given by HISTORY, - where HISTORY[0] is the most recent instruction. If INSN is null, + immediately followed the MAX_NOPS instructions given by HIST, + where HIST[0] is the most recent instruction. If INSN is null, return the worse-case number of nops for any instruction. */ static int -nops_for_insn (const struct mips_cl_insn *history, +nops_for_insn (const struct mips_cl_insn *hist, const struct mips_cl_insn *insn) { int i, nops, tmp_nops; @@ -2666,14 +2666,14 @@ nops_for_insn (const struct mips_cl_insn *history, nops = 0; for (i = 0; i < MAX_DELAY_NOPS; i++) { - tmp_nops = insns_between (history + i, insn) - i; + tmp_nops = insns_between (hist + i, insn) - i; if (tmp_nops > nops) nops = tmp_nops; } if (mips_fix_vr4130) { - tmp_nops = nops_for_vr4130 (history, insn); + tmp_nops = nops_for_vr4130 (hist, insn); if (tmp_nops > nops) nops = tmp_nops; } @@ -2682,20 +2682,20 @@ nops_for_insn (const struct mips_cl_insn *history, } /* The variable arguments provide NUM_INSNS extra instructions that - might be added to HISTORY. Return the largest number of nops that + might be added to HIST. Return the largest number of nops that would be needed after the extended sequence. */ static int -nops_for_sequence (int num_insns, const struct mips_cl_insn *history, ...) +nops_for_sequence (int num_insns, const struct mips_cl_insn *hist, ...) { va_list args; struct mips_cl_insn buffer[MAX_NOPS]; struct mips_cl_insn *cursor; int nops; - va_start (args, history); + va_start (args, hist); cursor = buffer + num_insns; - memcpy (cursor, history, (MAX_NOPS - num_insns) * sizeof (*cursor)); + memcpy (cursor, hist, (MAX_NOPS - num_insns) * sizeof (*cursor)); while (cursor > buffer) *--cursor = *va_arg (args, const struct mips_cl_insn *); @@ -2708,23 +2708,23 @@ nops_for_sequence (int num_insns, const struct mips_cl_insn *history, ...) worst-case delay for the branch target. */ static int -nops_for_insn_or_target (const struct mips_cl_insn *history, +nops_for_insn_or_target (const struct mips_cl_insn *hist, const struct mips_cl_insn *insn) { int nops, tmp_nops; - nops = nops_for_insn (history, insn); + nops = nops_for_insn (hist, insn); if (insn->insn_mo->pinfo & (INSN_UNCOND_BRANCH_DELAY | INSN_COND_BRANCH_DELAY | INSN_COND_BRANCH_LIKELY)) { - tmp_nops = nops_for_sequence (2, history, insn, NOP_INSN); + tmp_nops = nops_for_sequence (2, hist, insn, NOP_INSN); if (tmp_nops > nops) nops = tmp_nops; } else if (mips_opts.mips16 && (insn->insn_mo->pinfo & MIPS16_INSN_BRANCH)) { - tmp_nops = nops_for_sequence (1, history, insn); + tmp_nops = nops_for_sequence (1, hist, insn); if (tmp_nops > nops) nops = tmp_nops; } @@ -5754,8 +5754,6 @@ macro (struct mips_cl_insn *ip) } else if (IS_SEXT_32BIT_NUM (expr1.X_add_number + 0x8000)) { - int dreg; - /* If we are going to add in a base register, and the target register and the base register are the same, then we are using AT as a temporary register. Since @@ -5895,8 +5893,6 @@ macro (struct mips_cl_insn *ip) } else { - int dreg; - /* If we are going to add in a base register, and the target register and the base register are the same, then we are using AT as a temporary register. Since @@ -6034,8 +6030,6 @@ macro (struct mips_cl_insn *ip) } else if (IS_SEXT_32BIT_NUM (expr1.X_add_number + 0x8000)) { - int dreg; - /* If we are going to add in a base register, and the target register and the base register are the same, then we are using AT as a temporary register. Since @@ -7550,7 +7544,8 @@ macro2 (struct mips_cl_insn *ip) case M_DROL_I: { unsigned int rot; - char *l, *r; + char *l; + char *rr; if (imm_expr.X_op != O_constant) as_bad (_("Improper rotate count")); @@ -7570,11 +7565,11 @@ macro2 (struct mips_cl_insn *ip) break; } l = (rot < 0x20) ? "dsll" : "dsll32"; - r = ((0x40 - rot) < 0x20) ? "dsrl" : "dsrl32"; + rr = ((0x40 - rot) < 0x20) ? "dsrl" : "dsrl32"; rot &= 0x1f; used_at = 1; macro_build (NULL, l, "d,w,<", AT, sreg, rot); - macro_build (NULL, r, "d,w,<", dreg, sreg, (0x20 - rot) & 0x1f); + macro_build (NULL, rr, "d,w,<", dreg, sreg, (0x20 - rot) & 0x1f); macro_build (NULL, "or", "d,v,t", dreg, dreg, AT); } break; @@ -7632,7 +7627,8 @@ macro2 (struct mips_cl_insn *ip) case M_DROR_I: { unsigned int rot; - char *l, *r; + char *l; + char *rr; if (imm_expr.X_op != O_constant) as_bad (_("Improper rotate count")); @@ -7650,11 +7646,11 @@ macro2 (struct mips_cl_insn *ip) macro_build (NULL, "dsrl", "d,w,<", dreg, sreg, 0); break; } - r = (rot < 0x20) ? "dsrl" : "dsrl32"; + rr = (rot < 0x20) ? "dsrl" : "dsrl32"; l = ((0x40 - rot) < 0x20) ? "dsll" : "dsll32"; rot &= 0x1f; used_at = 1; - macro_build (NULL, r, "d,w,<", AT, sreg, rot); + macro_build (NULL, rr, "d,w,<", AT, sreg, rot); macro_build (NULL, l, "d,w,<", dreg, sreg, (0x20 - rot) & 0x1f); macro_build (NULL, "or", "d,v,t", dreg, dreg, AT); } @@ -10601,7 +10597,7 @@ mips16_ip (char *str, struct mips_cl_insn *ip) { int opcode = 0; int framesz = 0, seen_framesz = 0; - int args = 0, statics = 0, sregs = 0; + int nargs = 0, statics = 0, sregs = 0; while (*s != '\0') { @@ -10656,7 +10652,7 @@ mips16_ip (char *str, struct mips_cl_insn *ip) { if (!seen_framesz) /* args $a0-$a3 */ - args |= 1 << (reg1 - 4); + nargs |= 1 << (reg1 - 4); else /* statics $a0-$a3 */ statics |= 1 << (reg1 - 4); @@ -10682,9 +10678,9 @@ mips16_ip (char *str, struct mips_cl_insn *ip) } /* Encode args/statics combination. */ - if (args & statics) + if (nargs & statics) as_bad (_("arg/static registers overlap")); - else if (args == 0xf) + else if (nargs == 0xf) /* All $a0-$a3 are args. */ opcode |= MIPS16_ALL_ARGS << 16; else if (statics == 0xf) @@ -10695,12 +10691,12 @@ mips16_ip (char *str, struct mips_cl_insn *ip) int narg = 0, nstat = 0; /* Count arg registers. */ - while (args & 0x1) + while (nargs & 0x1) { - args >>= 1; + nargs >>= 1; narg++; } - if (args != 0) + if (nargs != 0) as_bad (_("invalid arg register list")); /* Count static registers. */ diff --git a/gas/config/tc-mn10200.c b/gas/config/tc-mn10200.c index 4f7cccb..f9bf78b 100644 --- a/gas/config/tc-mn10200.c +++ b/gas/config/tc-mn10200.c @@ -1241,12 +1241,12 @@ keep_going: for (i = 0; i < fc; i++) { const struct mn10200_operand *operand; + int reloc_size; operand = &mn10200_operands[fixups[i].opindex]; if (fixups[i].reloc != BFD_RELOC_UNUSED) { reloc_howto_type *reloc_howto; - int size; int offset; fixS *fixP; @@ -1256,14 +1256,14 @@ keep_going: if (!reloc_howto) abort (); - size = bfd_get_reloc_size (reloc_howto); + reloc_size = bfd_get_reloc_size (reloc_howto); - if (size < 1 || size > 4) + if (reloc_size < 1 || reloc_size > 4) abort (); - offset = 4 - size; + offset = 4 - reloc_size; fixP = fix_new_exp (frag_now, f - frag_now->fr_literal + offset, - size, + reloc_size, &fixups[i].exp, reloc_howto->pc_relative, fixups[i].reloc); @@ -1272,11 +1272,11 @@ keep_going: next instruction, not from the start of the current instruction. */ if (reloc_howto->pc_relative) - fixP->fx_offset += size; + fixP->fx_offset += reloc_size; } else { - int reloc, pcrel, reloc_size, offset; + int reloc, pcrel, offset; fixS *fixP; reloc = BFD_RELOC_NONE; diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c index 9ac44ad..1ddb110 100644 --- a/gas/config/tc-mn10300.c +++ b/gas/config/tc-mn10300.c @@ -1772,8 +1772,6 @@ keep_going: that they do indeed not match. */ if (opcode->no_match_operands) { - int i; - /* Look at each operand to see if it's marked. */ for (i = 0; i < MN10300_MAX_OPERANDS; i++) { @@ -2056,6 +2054,7 @@ keep_going: for (i = 0; i < fc; i++) { const struct mn10300_operand *operand; + int reloc_size; operand = &mn10300_operands[fixups[i].opindex]; if (fixups[i].reloc != BFD_RELOC_UNUSED @@ -2065,7 +2064,6 @@ keep_going: && fixups[i].reloc != BFD_RELOC_MN10300_GOT32) { reloc_howto_type *reloc_howto; - int size; int offset; fixS *fixP; @@ -2075,20 +2073,20 @@ keep_going: if (!reloc_howto) abort (); - size = bfd_get_reloc_size (reloc_howto); + reloc_size = bfd_get_reloc_size (reloc_howto); - if (size < 1 || size > 4) + if (reloc_size < 1 || reloc_size > 4) abort (); offset = 4 - size; fixP = fix_new_exp (frag_now, f - frag_now->fr_literal + offset, - size, &fixups[i].exp, + reloc_size, &fixups[i].exp, reloc_howto->pc_relative, fixups[i].reloc); } else { - int reloc, pcrel, reloc_size, offset; + int reloc, pcrel, offset; fixS *fixP; reloc = BFD_RELOC_NONE; diff --git a/gas/config/tc-ns32k.c b/gas/config/tc-ns32k.c index 20f6cd0..aaebde4 100644 --- a/gas/config/tc-ns32k.c +++ b/gas/config/tc-ns32k.c @@ -375,7 +375,7 @@ char disp_size[] = static int addr_mode (char *operand, - addr_modeS *addr_modeP, + addr_modeS *addrmodeP, int recursive_level) { char *str; @@ -385,16 +385,16 @@ addr_mode (char *operand, int j; mode = DEFAULT; /* Default. */ - addr_modeP->scaled_mode = 0; /* Why not. */ - addr_modeP->scaled_reg = 0; /* If 0, not scaled index. */ - addr_modeP->float_flag = 0; - addr_modeP->am_size = 0; - addr_modeP->im_disp = 0; - addr_modeP->pcrel = 0; /* Not set in this function. */ - addr_modeP->disp_suffix[0] = 0; - addr_modeP->disp_suffix[1] = 0; - addr_modeP->disp[0] = NULL; - addr_modeP->disp[1] = NULL; + addrmodeP->scaled_mode = 0; /* Why not. */ + addrmodeP->scaled_reg = 0; /* If 0, not scaled index. */ + addrmodeP->float_flag = 0; + addrmodeP->am_size = 0; + addrmodeP->im_disp = 0; + addrmodeP->pcrel = 0; /* Not set in this function. */ + addrmodeP->disp_suffix[0] = 0; + addrmodeP->disp_suffix[1] = 0; + addrmodeP->disp[0] = NULL; + addrmodeP->disp[1] = NULL; str = operand; if (str[0] == 0) @@ -410,16 +410,16 @@ addr_mode (char *operand, case ABSOLUTE_PREFIX: if (str[strl - 1] == ']') break; - addr_modeP->mode = 21; /* absolute */ - addr_modeP->disp[0] = str + 1; + addrmodeP->mode = 21; /* absolute */ + addrmodeP->disp[0] = str + 1; return -1; #endif #ifdef IMMEDIATE_PREFIX case IMMEDIATE_PREFIX: if (str[strl - 1] == ']') break; - addr_modeP->mode = 20; /* immediate */ - addr_modeP->disp[0] = str + 1; + addrmodeP->mode = 20; /* immediate */ + addrmodeP->disp[0] = str + 1; return -1; #endif case '.': @@ -431,8 +431,8 @@ addr_mode (char *operand, case '+': if (str[2] != '\000') { - addr_modeP->mode = 27; /* pc-relative */ - addr_modeP->disp[0] = str + 2; + addrmodeP->mode = 27; /* pc-relative */ + addrmodeP->disp[0] = str + 2; return -1; } default: @@ -446,7 +446,7 @@ addr_mode (char *operand, { if ((!strncmp (str, "ext(", 4)) && strl > 7) { /* external */ - addr_modeP->disp[0] = str + 4; + addrmodeP->disp[0] = str + 4; i = 0; j = 2; do @@ -464,8 +464,8 @@ addr_mode (char *operand, return (0); } str[j] = '\000'; /* null terminate disp[0] */ - addr_modeP->disp[1] = str + j + 2; - addr_modeP->mode = 22; + addrmodeP->disp[1] = str + j + 2; + addrmodeP->mode = 22; return -1; } } @@ -483,12 +483,12 @@ addr_mode (char *operand, switch (str[0]) { case 'f': - addr_modeP->float_flag = 1; + addrmodeP->float_flag = 1; /* Drop through. */ case 'r': if (str[1] >= '0' && str[1] < '8') { - addr_modeP->mode = str[1] - '0'; + addrmodeP->mode = str[1] - '0'; return -1; } break; @@ -500,7 +500,7 @@ addr_mode (char *operand, case 3: if (!strncmp (str, "tos", 3)) { - addr_modeP->mode = 23; /* TopOfStack */ + addrmodeP->mode = 23; /* TopOfStack */ return -1; } break; @@ -525,7 +525,7 @@ addr_mode (char *operand, if (mode != DEFAULT) { /* Memory relative. */ - addr_modeP->mode = mode; + addrmodeP->mode = mode; j = strl - 5; /* Temp for end of disp[0]. */ i = 0; @@ -545,8 +545,8 @@ addr_mode (char *operand, return (0); } - addr_modeP->disp[1] = str; - addr_modeP->disp[0] = str + strl + 1; + addrmodeP->disp[1] = str; + addrmodeP->disp[0] = str + strl + 1; str[j] = '\000'; /* Null terminate disp[0] . */ str[strl] = '\000'; /* Null terminate disp[1]. */ @@ -562,8 +562,8 @@ addr_mode (char *operand, && str[strl - 2] < '8' && str[strl - 4] == '(') { - addr_modeP->mode = str[strl - 2] - '0' + 8; - addr_modeP->disp[0] = str; + addrmodeP->mode = str[strl - 2] - '0' + 8; + addrmodeP->disp[0] = str; str[strl - 4] = 0; return -1; /* reg rel */ } @@ -581,8 +581,8 @@ addr_mode (char *operand, if (mode != DEFAULT) { - addr_modeP->mode = mode; - addr_modeP->disp[0] = str; + addrmodeP->mode = mode; + addrmodeP->disp[0] = str; str[strl - 4] = '\0'; return -1; /* Memory space. */ @@ -622,27 +622,27 @@ addr_mode (char *operand, return 0; } - addr_modeP->am_size += 1; /* scaled index byte. */ + addrmodeP->am_size += 1; /* scaled index byte. */ j = str[strl - 4] - '0'; /* store temporary. */ str[strl - 6] = '\000'; /* nullterminate for recursive call. */ - i = addr_mode (str, addr_modeP, 1); + i = addr_mode (str, addrmodeP, 1); - if (!i || addr_modeP->mode == 20) + if (!i || addrmodeP->mode == 20) { as_bad (_("Invalid or illegal addressing mode combined with scaled-index")); return 0; } - addr_modeP->scaled_mode = addr_modeP->mode; /* Store the inferior mode. */ - addr_modeP->mode = mode; - addr_modeP->scaled_reg = j + 1; + addrmodeP->scaled_mode = addrmodeP->mode; /* Store the inferior mode. */ + addrmodeP->mode = mode; + addrmodeP->scaled_reg = j + 1; return -1; } } - addr_modeP->mode = DEFAULT; /* Default to whatever. */ - addr_modeP->disp[0] = str; + addrmodeP->mode = DEFAULT; /* Default to whatever. */ + addrmodeP->disp[0] = str; return -1; } @@ -665,13 +665,13 @@ evaluate_expr (expressionS *resultP, char *ptr) ns32k-opcode. Also builds index bytes if needed. */ static int -get_addr_mode (char *ptr, addr_modeS *addr_modeP) +get_addr_mode (char *ptr, addr_modeS *addrmodeP) { int tmp; - addr_mode (ptr, addr_modeP, 0); + addr_mode (ptr, addrmodeP, 0); - if (addr_modeP->mode == DEFAULT || addr_modeP->scaled_mode == -1) + if (addrmodeP->mode == DEFAULT || addrmodeP->scaled_mode == -1) { /* Resolve ambiguous operands, this shouldn't be necessary if one uses standard NSC operand syntax. But the sequent @@ -679,19 +679,19 @@ get_addr_mode (char *ptr, addr_modeS *addr_modeP) if it is implicitly stated. See ns32k-opcode.h. */ (void) evaluate_expr (&exprP, ptr); /* This call takes time Sigh! */ - if (addr_modeP->mode == DEFAULT) + if (addrmodeP->mode == DEFAULT) { if (exprP.X_add_symbol || exprP.X_op_symbol) - addr_modeP->mode = desc->default_model; /* We have a label. */ + addrmodeP->mode = desc->default_model; /* We have a label. */ else - addr_modeP->mode = desc->default_modec; /* We have a constant. */ + addrmodeP->mode = desc->default_modec; /* We have a constant. */ } else { if (exprP.X_add_symbol || exprP.X_op_symbol) - addr_modeP->scaled_mode = desc->default_model; + addrmodeP->scaled_mode = desc->default_model; else - addr_modeP->scaled_mode = desc->default_modec; + addrmodeP->scaled_mode = desc->default_modec; } /* Must put this mess down in addr_mode to handle the scaled @@ -703,17 +703,17 @@ get_addr_mode (char *ptr, addr_modeS *addr_modeP) case. Think it does so with local labels too, not optimum, pcrel is better. When I have time I will make gas check this and select pcrel when possible Actually that is trivial. */ - if ((tmp = addr_modeP->scaled_reg)) + if ((tmp = addrmodeP->scaled_reg)) { /* Build indexbyte. */ tmp--; /* Remember regnumber comes incremented for flagpurpose. */ - tmp |= addr_modeP->scaled_mode << 3; - addr_modeP->index_byte = (char) tmp; - addr_modeP->am_size += 1; + tmp |= addrmodeP->scaled_mode << 3; + addrmodeP->index_byte = (char) tmp; + addrmodeP->am_size += 1; } - gas_assert (addr_modeP->mode >= 0); - if (disp_test[(unsigned int) addr_modeP->mode]) + gas_assert (addrmodeP->mode >= 0); + if (disp_test[(unsigned int) addrmodeP->mode]) { char c; char suffix; @@ -723,23 +723,23 @@ get_addr_mode (char *ptr, addr_modeS *addr_modeP) char *fromP; /* There was a displacement, probe for length specifying suffix. */ - addr_modeP->pcrel = 0; + addrmodeP->pcrel = 0; - gas_assert (addr_modeP->mode >= 0); - if (disp_test[(unsigned int) addr_modeP->mode]) + gas_assert (addrmodeP->mode >= 0); + if (disp_test[(unsigned int) addrmodeP->mode]) { /* There is a displacement. */ - if (addr_modeP->mode == 27 || addr_modeP->scaled_mode == 27) + if (addrmodeP->mode == 27 || addrmodeP->scaled_mode == 27) /* Do we have pcrel. mode. */ - addr_modeP->pcrel = 1; + addrmodeP->pcrel = 1; - addr_modeP->im_disp = 1; + addrmodeP->im_disp = 1; for (i = 0; i < 2; i++) { suffix_sub = suffix = 0; - if ((toP = addr_modeP->disp[i])) + if ((toP = addrmodeP->disp[i])) { /* Suffix of expression, the largest size rules. */ fromP = toP; @@ -778,23 +778,23 @@ get_addr_mode (char *ptr, addr_modeS *addr_modeP) } *toP = '\0'; /* Terminate properly. */ - addr_modeP->disp_suffix[i] = suffix; - addr_modeP->am_size += suffix ? suffix : 4; + addrmodeP->disp_suffix[i] = suffix; + addrmodeP->am_size += suffix ? suffix : 4; } } } } else { - if (addr_modeP->mode == 20) + if (addrmodeP->mode == 20) { /* Look in ns32k_opcode for size. */ - addr_modeP->disp_suffix[0] = addr_modeP->am_size = desc->im_size; - addr_modeP->im_disp = 0; + addrmodeP->disp_suffix[0] = addrmodeP->am_size = desc->im_size; + addrmodeP->im_disp = 0; } } - return addr_modeP->mode; + return addrmodeP->mode; } /* Read an optionlist. */ @@ -1246,7 +1246,7 @@ parse (const char *line, int recursive_level) static bfd_reloc_code_real_type reloc (int size, int pcrel, int type) { - int length, index; + int length, rel_index; bfd_reloc_code_real_type relocs[] = { BFD_RELOC_NS32K_IMM_8, @@ -1289,10 +1289,10 @@ reloc (int size, int pcrel, int type) break; } - index = length + 3 * pcrel + 6 * type; + rel_index = length + 3 * pcrel + 6 * type; - if (index >= 0 && (unsigned int) index < sizeof (relocs) / sizeof (relocs[0])) - return relocs[index]; + if (rel_index >= 0 && (unsigned int) rel_index < sizeof (relocs) / sizeof (relocs[0])) + return relocs[rel_index]; if (pcrel) as_bad (_("Can not do %d byte pc-relative relocation for storage type %d"), diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 1d615e9..e677602 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -877,7 +877,7 @@ static const struct pd_reg cr_names[] = expression. */ int -ppc_parse_name (const char *name, expressionS *expr) +ppc_parse_name (const char *name, expressionS *exp) { int val; @@ -891,8 +891,8 @@ ppc_parse_name (const char *name, expressionS *expr) if (val < 0) return 0; - expr->X_op = O_constant; - expr->X_add_number = val; + exp->X_op = O_constant; + exp->X_add_number = val; return 1; } @@ -1624,7 +1624,7 @@ static unsigned long ppc_insert_operand (unsigned long insn, const struct powerpc_operand *operand, offsetT val, - ppc_cpu_t ppc_cpu, + ppc_cpu_t cpu, char *file, unsigned int line) { @@ -1683,7 +1683,7 @@ ppc_insert_operand (unsigned long insn, const char *errmsg; errmsg = NULL; - insn = (*operand->insert) (insn, (long) val, ppc_cpu, &errmsg); + insn = (*operand->insert) (insn, (long) val, cpu, &errmsg); if (errmsg != (const char *) NULL) as_bad_where (file, line, "%s", errmsg); } @@ -2381,7 +2381,6 @@ md_assemble (char *str) { unsigned int opcount; unsigned int num_operands_expected; - unsigned int i; /* There is an optional operand. Count the number of commas in the input line. */ @@ -3779,16 +3778,16 @@ ppc_function (int ignore ATTRIBUTE_UNUSED) if (*input_line_pointer == ',') { - expressionS ignore; + expressionS exp; /* Ignore the third argument. */ ++input_line_pointer; - expression (&ignore); + expression (& exp); if (*input_line_pointer == ',') { /* Ignore the fourth argument. */ ++input_line_pointer; - expression (&ignore); + expression (& exp); if (*input_line_pointer == ',') { /* The fifth argument is the function size. */ diff --git a/gas/config/tc-score.c b/gas/config/tc-score.c index 22da682..61220de 100644 --- a/gas/config/tc-score.c +++ b/gas/config/tc-score.c @@ -58,7 +58,7 @@ static void s_score_lcomm (int bytes_p); static void s3_md_number_to_chars (char *buf, valueT val, int n); static valueT s3_md_chars_to_number (char *buf, int n); static void s3_assemble (char *str); -static void s3_operand (expressionS * expr); +static void s3_operand (expressionS *); static void s3_begin (void); static void s3_number_to_chars (char *buf, valueT val, int n); static char *s3_atof (int type, char *litP, int *sizeP); @@ -3138,7 +3138,6 @@ s3_do_ldst_insn (char *str) if (s3_inst.reloc.exp.X_op == O_constant) { - int value; unsigned int data_type; if (pre_inc == 1) @@ -6510,11 +6509,11 @@ s3_assemble (char *str) } static void -s3_operand (expressionS * expr) +s3_operand (expressionS * exp) { if (s3_in_my_get_expression) { - expr->X_op = O_illegal; + exp->X_op = O_illegal; if (s3_inst.error == NULL) { s3_inst.error = _("bad expression"); @@ -7522,12 +7521,12 @@ md_assemble (char *str) /* We handle all bad expressions here, so that we can report the faulty instruction in the error message. */ void -md_operand (expressionS * expr) +md_operand (expressionS * exp) { if (score3) - s3_operand (expr); + s3_operand (exp); else - s7_operand (expr); + s7_operand (exp); } /* Turn an integer of n bytes (in val) into a stream of bytes appropriate diff --git a/gas/config/tc-score7.c b/gas/config/tc-score7.c index c931102..9edd699 100644 --- a/gas/config/tc-score7.c +++ b/gas/config/tc-score7.c @@ -3306,7 +3306,6 @@ s7_do_ldst_insn (char *str) if (s7_inst.reloc.exp.X_op == O_constant) { - int value; unsigned int data_type; if (pre_inc == 1) @@ -6194,11 +6193,11 @@ s7_assemble (char *str) instruction in the error message. */ static void -s7_operand (expressionS * expr) +s7_operand (expressionS * exp) { if (s7_in_my_get_expression) { - expr->X_op = O_illegal; + exp->X_op = O_illegal; if (s7_inst.error == NULL) { s7_inst.error = _("bad expression"); diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index 702b0b4..42f01e9 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -2320,7 +2320,7 @@ insert_loop_bounds (char *output, sh_operand_info *operand) static unsigned int build_Mytes (sh_opcode_info *opcode, sh_operand_info *operand) { - int index; + int indx; char nbuf[8]; char *output; unsigned int size = 2; @@ -2345,12 +2345,12 @@ build_Mytes (sh_opcode_info *opcode, sh_operand_info *operand) else output = frag_more (2); - for (index = 0; index < max_index; index++) + for (indx = 0; indx < max_index; indx++) { - sh_nibble_type i = opcode->nibbles[index]; + sh_nibble_type i = opcode->nibbles[indx]; if (i < 16) { - nbuf[index] = i; + nbuf[indx] = i; } else { @@ -2358,32 +2358,32 @@ build_Mytes (sh_opcode_info *opcode, sh_operand_info *operand) { case REG_N: case REG_N_D: - nbuf[index] = reg_n; + nbuf[indx] = reg_n; break; case REG_M: - nbuf[index] = reg_m; + nbuf[indx] = reg_m; break; case SDT_REG_N: if (reg_n < 2 || reg_n > 5) as_bad (_("Invalid register: 'r%d'"), reg_n); - nbuf[index] = (reg_n & 3) | 4; + nbuf[indx] = (reg_n & 3) | 4; break; case REG_NM: - nbuf[index] = reg_n | (reg_m >> 2); + nbuf[indx] = reg_n | (reg_m >> 2); break; case REG_B: - nbuf[index] = reg_b | 0x08; + nbuf[indx] = reg_b | 0x08; break; case REG_N_B01: - nbuf[index] = reg_n | 0x01; + nbuf[indx] = reg_n | 0x01; break; case IMM0_3s: - nbuf[index] |= 0x08; + nbuf[indx] |= 0x08; case IMM0_3c: insert (output + low_byte, BFD_RELOC_SH_IMM3, 0, operand); break; case IMM0_3Us: - nbuf[index] |= 0x80; + nbuf[indx] |= 0x80; case IMM0_3Uc: insert (output + low_byte, BFD_RELOC_SH_IMM3U, 0, operand); break; @@ -2465,7 +2465,7 @@ build_Mytes (sh_opcode_info *opcode, sh_operand_info *operand) break; case REPEAT: output = insert_loop_bounds (output, operand); - nbuf[index] = opcode->nibbles[3]; + nbuf[indx] = opcode->nibbles[3]; operand += 2; break; default: diff --git a/gas/config/tc-sh64.c b/gas/config/tc-sh64.c index 7610a49..db69846 100644 --- a/gas/config/tc-sh64.c +++ b/gas/config/tc-sh64.c @@ -3273,9 +3273,9 @@ sh64_consume_datalabel (const char *name, expressionS *exp, else { symbolS *dl_symp; - const char *name = S_GET_NAME (symp); + const char * sname = S_GET_NAME (symp); char *dl_name - = xmalloc (strlen (name) + sizeof (DATALABEL_SUFFIX)); + = xmalloc (strlen (sname) + sizeof (DATALABEL_SUFFIX)); /* Now we copy the datalabel-qualified symbol into a symbol with the same name, but with " DL" appended. We mark the @@ -3283,13 +3283,13 @@ sh64_consume_datalabel (const char *name, expressionS *exp, the main symbol, so we don't have to inspect all symbol names. Note that use of "datalabel" is not expected to be a common case. */ - strcpy (dl_name, name); + strcpy (dl_name, sname); strcat (dl_name, DATALABEL_SUFFIX); /* A FAKE_LABEL_NAME marks "$" or ".". There can be any number of them and all have the same (faked) name; we must make a new one each time. */ - if (strcmp (name, FAKE_LABEL_NAME) == 0) + if (strcmp (sname, FAKE_LABEL_NAME) == 0) dl_symp = symbol_make (dl_name); else dl_symp = symbol_find_or_make (dl_name); diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index 1be7760..26ecc86 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -1446,15 +1446,15 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) { while (*s == '#') { - int mask; + int jmask; if (! parse_keyword_arg (sparc_encode_membar, &s, - &mask)) + &jmask)) { error_message = _(": invalid membar mask name"); goto error; } - kmask |= mask; + kmask |= jmask; while (*s == ' ') ++s; if (*s == '|' || *s == '+') @@ -2890,36 +2890,36 @@ get_expression (char *str) /* Subroutine of md_assemble to output one insn. */ static void -output_insn (const struct sparc_opcode *insn, struct sparc_it *the_insn) +output_insn (const struct sparc_opcode *insn, struct sparc_it *theinsn) { char *toP = frag_more (4); /* Put out the opcode. */ if (INSN_BIG_ENDIAN) - number_to_chars_bigendian (toP, (valueT) the_insn->opcode, 4); + number_to_chars_bigendian (toP, (valueT) theinsn->opcode, 4); else - number_to_chars_littleendian (toP, (valueT) the_insn->opcode, 4); + number_to_chars_littleendian (toP, (valueT) theinsn->opcode, 4); /* Put out the symbol-dependent stuff. */ - if (the_insn->reloc != BFD_RELOC_NONE) + if (theinsn->reloc != BFD_RELOC_NONE) { fixS *fixP = fix_new_exp (frag_now, /* Which frag. */ (toP - frag_now->fr_literal), /* Where. */ 4, /* Size. */ - &the_insn->exp, - the_insn->pcrel, - the_insn->reloc); + &theinsn->exp, + theinsn->pcrel, + theinsn->reloc); /* Turn off overflow checking in fixup_segment. We'll do our own overflow checking in md_apply_fix. This is necessary because the insn size is 4 and fixup_segment will signal an overflow for large 8 byte quantities. */ fixP->fx_no_overflow = 1; - if (the_insn->reloc == BFD_RELOC_SPARC_OLO10) - fixP->tc_fix_data = the_insn->exp2.X_add_number; + if (theinsn->reloc == BFD_RELOC_SPARC_OLO10) + fixP->tc_fix_data = theinsn->exp2.X_add_number; } last_insn = insn; - last_opcode = the_insn->opcode; + last_opcode = theinsn->opcode; #ifdef OBJ_ELF dwarf2_emit_insn (4); @@ -3869,7 +3869,6 @@ s_common (int ignore ATTRIBUTE_UNUSED) { segT old_sec; int old_subsec; - char *p; int align; old_sec = now_seg; diff --git a/gas/config/tc-tic30.c b/gas/config/tc-tic30.c index d4d98d5..7dea5d7 100644 --- a/gas/config/tc-tic30.c +++ b/gas/config/tc-tic30.c @@ -327,19 +327,19 @@ tic30_find_parallel_insn (char *current_line, char *next_line) { int i; - char *opcode, *operands, *line; + char *op, *operands, *line; for (i = 0; i < 2; i++) { if (i == 0) { - opcode = &first_opcode[0]; + op = &first_opcode[0]; operands = &first_operands[0]; line = current_line; } else { - opcode = &second_opcode[0]; + op = &second_opcode[0]; operands = &second_operands[0]; line = next_line; } @@ -353,14 +353,14 @@ tic30_find_parallel_insn (char *current_line, char *next_line) { if (is_opcode_char (c) && search_status == NONE) { - opcode[char_ptr++] = TOLOWER (c); + op[char_ptr++] = TOLOWER (c); search_status = START_OPCODE; } else if (is_opcode_char (c) && search_status == START_OPCODE) - opcode[char_ptr++] = TOLOWER (c); + op[char_ptr++] = TOLOWER (c); else if (!is_opcode_char (c) && search_status == START_OPCODE) { - opcode[char_ptr] = '\0'; + op[char_ptr] = '\0'; char_ptr = 0; search_status = END_OPCODE; } @@ -620,8 +620,6 @@ tic30_operand (char *token) } else { - unsigned count; - debug ("Found a number or displacement\n"); for (count = 0; count < strlen (token); count++) if (*(token + count) == '.') @@ -1307,42 +1305,42 @@ md_atof (int what_statement_type, } if (prec == 2) { - long exp, mant; + long expon, mantis; if (tmsfloat == 0x80000000) value = 0x8000; else { value = 0; - exp = (tmsfloat & 0xFF000000); - exp >>= 24; - mant = tmsfloat & 0x007FFFFF; + expon = (tmsfloat & 0xFF000000); + expon >>= 24; + mantis = tmsfloat & 0x007FFFFF; if (tmsfloat & 0x00800000) { - mant |= 0xFF000000; - mant += 0x00000800; - mant >>= 12; - mant |= 0x00000800; - mant &= 0x0FFF; - if (exp > 7) + mantis |= 0xFF000000; + mantis += 0x00000800; + mantis >>= 12; + mantis |= 0x00000800; + mantis &= 0x0FFF; + if (expon > 7) value = 0x7800; } else { - mant |= 0x00800000; - mant += 0x00000800; - exp += (mant >> 24); - mant >>= 12; - mant &= 0x07FF; - if (exp > 7) + mantis |= 0x00800000; + mantis += 0x00000800; + expon += (mantis >> 24); + mantis >>= 12; + mantis &= 0x07FF; + if (expon > 7) value = 0x77FF; } - if (exp < -8) + if (expon < -8) value = 0x8000; if (value == 0) { - mant = (exp << 12) | mant; - value = mant & 0xFFFF; + mantis = (expon << 12) | mantis; + value = mantis & 0xFFFF; } } } @@ -1416,7 +1414,7 @@ md_operand (expressionS *expressionP ATTRIBUTE_UNUSED) void md_assemble (char *line) { - insn_template *opcode; + insn_template *op; char *current_posn; char *token_start; char save_char; @@ -1464,11 +1462,11 @@ md_assemble (char *line) /* Find instruction. */ save_char = *current_posn; *current_posn = '\0'; - opcode = (insn_template *) hash_find (op_hash, token_start); - if (opcode) + op = (insn_template *) hash_find (op_hash, token_start); + if (op) { - debug ("Found instruction %s\n", opcode->name); - insn.tm = opcode; + debug ("Found instruction %s\n", op->name); + insn.tm = op; } else { diff --git a/gas/config/tc-tic4x.c b/gas/config/tc-tic4x.c index 3ff6cbc..fd98c2c 100644 --- a/gas/config/tc-tic4x.c +++ b/gas/config/tc-tic4x.c @@ -1248,7 +1248,7 @@ tic4x_inst_make (char *name, unsigned long opcode, char *args) { static tic4x_inst_t *insts = NULL; static char *names = NULL; - static int index = 0; + static int iindex = 0; if (insts == NULL) { @@ -1258,18 +1258,18 @@ tic4x_inst_make (char *name, unsigned long opcode, char *args) insts = (tic4x_inst_t *) xmalloc (sizeof (tic4x_inst_t) * 1024); } - insts[index].name = names; - insts[index].opcode = opcode; - insts[index].opmask = 0xffffffff; - insts[index].args = args; - index++; + insts[iindex].name = names; + insts[iindex].opcode = opcode; + insts[iindex].opmask = 0xffffffff; + insts[iindex].args = args; + iindex++; do *names++ = *name++; while (*name); *names++ = '\0'; - return &insts[index - 1]; + return &insts[iindex - 1]; } /* Add instruction template, creating dynamic templates as required. */ @@ -1672,12 +1672,12 @@ tic4x_operand_parse (char *s, tic4x_operand_t *operand) } static int -tic4x_operands_match (tic4x_inst_t *inst, tic4x_insn_t *insn, int check) +tic4x_operands_match (tic4x_inst_t *inst, tic4x_insn_t *tinsn, int check) { const char *args = inst->args; unsigned long opcode = inst->opcode; - int num_operands = insn->num_operands; - tic4x_operand_t *operand = insn->operands; + int num_operands = tinsn->num_operands; + tic4x_operand_t *operand = tinsn->operands; expressionS *exp = &operand->expr; int ret = 1; int reg; @@ -1688,13 +1688,13 @@ tic4x_operands_match (tic4x_inst_t *inst, tic4x_insn_t *insn, int check) If an operand matches, we modify insn or opcode appropriately, and do a "continue". If an operand fails to match, we "break". */ - insn->nchars = 4; /* Instructions always 4 bytes. */ - insn->reloc = NO_RELOC; - insn->pcrel = 0; + tinsn->nchars = 4; /* Instructions always 4 bytes. */ + tinsn->reloc = NO_RELOC; + tinsn->pcrel = 0; if (*args == '\0') { - insn->opcode = opcode; + tinsn->opcode = opcode; return num_operands == 0; } @@ -1706,7 +1706,7 @@ tic4x_operands_match (tic4x_inst_t *inst, tic4x_insn_t *insn, int check) case '\0': /* End of args. */ if (num_operands == 1) { - insn->opcode = opcode; + tinsn->opcode = opcode; return ret; } break; /* Too many operands. */ @@ -1735,8 +1735,8 @@ tic4x_operands_match (tic4x_inst_t *inst, tic4x_insn_t *insn, int check) } else if (exp->X_op == O_symbol) { - insn->reloc = BFD_RELOC_HI16; - insn->exp = *exp; + tinsn->reloc = BFD_RELOC_HI16; + tinsn->exp = *exp; continue; } break; /* Not direct (dp) addressing. */ @@ -1752,8 +1752,8 @@ tic4x_operands_match (tic4x_inst_t *inst, tic4x_insn_t *insn, int check) } else if (exp->X_op == O_symbol) { - insn->reloc = BFD_RELOC_LO16; - insn->exp = *exp; + tinsn->reloc = BFD_RELOC_LO16; + tinsn->exp = *exp; continue; } break; /* Not direct addressing. */ @@ -1794,15 +1794,15 @@ tic4x_operands_match (tic4x_inst_t *inst, tic4x_insn_t *insn, int check) } if (IS_CPU_TIC4X (tic4x_cpu)) { - insn->reloc = BFD_RELOC_24_PCREL; - insn->pcrel = 1; + tinsn->reloc = BFD_RELOC_24_PCREL; + tinsn->pcrel = 1; } else { - insn->reloc = BFD_RELOC_24; - insn->pcrel = 0; + tinsn->reloc = BFD_RELOC_24; + tinsn->pcrel = 0; } - insn->exp = *exp; + tinsn->exp = *exp; continue; case 'C': @@ -2048,9 +2048,9 @@ tic4x_operands_match (tic4x_inst_t *inst, tic4x_insn_t *insn, int check) continue; } } - insn->reloc = BFD_RELOC_16_PCREL; - insn->pcrel = 1; - insn->exp = *exp; + tinsn->reloc = BFD_RELOC_16_PCREL; + tinsn->pcrel = 1; + tinsn->exp = *exp; continue; case 'Q': @@ -2127,21 +2127,21 @@ tic4x_operands_match (tic4x_inst_t *inst, tic4x_insn_t *insn, int check) { if (operand->mode == M_HI) { - insn->reloc = BFD_RELOC_HI16; + tinsn->reloc = BFD_RELOC_HI16; } else { - insn->reloc = BFD_RELOC_LO16; + tinsn->reloc = BFD_RELOC_LO16; } - insn->exp = *exp; + tinsn->exp = *exp; continue; } /* Handle cases like ldi foo - $, ar0 where foo is a forward reference. Perhaps we should check for X_op == O_symbol and disallow things like ldi foo, ar0. */ - insn->reloc = BFD_RELOC_16; - insn->exp = *exp; + tinsn->reloc = BFD_RELOC_16; + tinsn->exp = *exp; continue; case 'T': /* 5-bit immediate value for tic4x stik. */ @@ -2189,15 +2189,15 @@ tic4x_operands_match (tic4x_inst_t *inst, tic4x_insn_t *insn, int check) else if (exp->X_op == O_symbol) { if (operand->mode == M_HI) - insn->reloc = BFD_RELOC_HI16; + tinsn->reloc = BFD_RELOC_HI16; else - insn->reloc = BFD_RELOC_LO16; + tinsn->reloc = BFD_RELOC_LO16; - insn->exp = *exp; + tinsn->exp = *exp; continue; } - insn->reloc = BFD_RELOC_16; - insn->exp = *exp; + tinsn->reloc = BFD_RELOC_16; + tinsn->exp = *exp; continue; case 'V': /* Trap numbers (immediate field). */ @@ -2254,8 +2254,8 @@ tic4x_operands_match (tic4x_inst_t *inst, tic4x_insn_t *insn, int check) continue; } } - insn->reloc = BFD_RELOC_16; - insn->exp = *exp; + tinsn->reloc = BFD_RELOC_16; + tinsn->exp = *exp; continue; case 'X': /* Expansion register for tic4x. */ @@ -2309,7 +2309,7 @@ tic4x_operands_match (tic4x_inst_t *inst, tic4x_insn_t *insn, int check) continue; case '|': /* treat as `,' if have ldi_ldi form. */ - if (insn->parallel) + if (tinsn->parallel) { if (--num_operands < 0) break; /* Too few operands. */ @@ -2343,57 +2343,57 @@ tic4x_operands_match (tic4x_inst_t *inst, tic4x_insn_t *insn, int check) } static void -tic4x_insn_check (tic4x_insn_t *insn) +tic4x_insn_check (tic4x_insn_t *tinsn) { - if (!strcmp(insn->name, "lda")) + if (!strcmp (tinsn->name, "lda")) { - if (insn->num_operands < 2 || insn->num_operands > 2) + if (tinsn->num_operands < 2 || tinsn->num_operands > 2) as_fatal ("Illegal internal LDA insn definition"); - if ( insn->operands[0].mode == M_REGISTER - && insn->operands[1].mode == M_REGISTER - && insn->operands[0].expr.X_add_number == insn->operands[1].expr.X_add_number ) + if (tinsn->operands[0].mode == M_REGISTER + && tinsn->operands[1].mode == M_REGISTER + && tinsn->operands[0].expr.X_add_number == tinsn->operands[1].expr.X_add_number ) as_bad (_("Source and destination register should not be equal")); } - else if( !strcmp(insn->name, "ldi_ldi") - || !strcmp(insn->name, "ldi1_ldi2") - || !strcmp(insn->name, "ldi2_ldi1") - || !strcmp(insn->name, "ldf_ldf") - || !strcmp(insn->name, "ldf1_ldf2") - || !strcmp(insn->name, "ldf2_ldf1") ) + else if (!strcmp (tinsn->name, "ldi_ldi") + || !strcmp (tinsn->name, "ldi1_ldi2") + || !strcmp (tinsn->name, "ldi2_ldi1") + || !strcmp (tinsn->name, "ldf_ldf") + || !strcmp (tinsn->name, "ldf1_ldf2") + || !strcmp (tinsn->name, "ldf2_ldf1") ) { - if ( insn->num_operands < 4 && insn->num_operands > 5 ) - as_fatal ("Illegal internal %s insn definition", insn->name); + if (tinsn->num_operands < 4 && tinsn->num_operands > 5 ) + as_fatal ("Illegal internal %s insn definition", tinsn->name); - if ( insn->operands[1].mode == M_REGISTER - && insn->operands[insn->num_operands-1].mode == M_REGISTER - && insn->operands[1].expr.X_add_number == insn->operands[insn->num_operands-1].expr.X_add_number ) + if (tinsn->operands[1].mode == M_REGISTER + && tinsn->operands[tinsn->num_operands-1].mode == M_REGISTER + && tinsn->operands[1].expr.X_add_number == tinsn->operands[tinsn->num_operands-1].expr.X_add_number ) as_warn (_("Equal parallell destination registers, one result will be discarded")); } } static void -tic4x_insn_output (tic4x_insn_t *insn) +tic4x_insn_output (tic4x_insn_t *tinsn) { char *dst; /* Grab another fragment for opcode. */ - dst = frag_more (insn->nchars); + dst = frag_more (tinsn->nchars); /* Put out opcode word as a series of bytes in little endian order. */ - md_number_to_chars (dst, insn->opcode, insn->nchars); + md_number_to_chars (dst, tinsn->opcode, tinsn->nchars); /* Put out the symbol-dependent stuff. */ - if (insn->reloc != NO_RELOC) + if (tinsn->reloc != NO_RELOC) { /* Where is the offset into the fragment for this instruction. */ fix_new_exp (frag_now, dst - frag_now->fr_literal, /* where */ - insn->nchars, /* size */ - &insn->exp, - insn->pcrel, - insn->reloc); + tinsn->nchars, /* size */ + &tinsn->exp, + tinsn->pcrel, + tinsn->reloc); } } diff --git a/gas/config/tc-tic54x.c b/gas/config/tc-tic54x.c index eb1815c..1a00bb4 100644 --- a/gas/config/tc-tic54x.c +++ b/gas/config/tc-tic54x.c @@ -243,11 +243,11 @@ md_show_usage (FILE *stream) static void tic54x_emit_char (char c) { - expressionS exp; + expressionS expn; - exp.X_op = O_constant; - exp.X_add_number = c; - emit_expr (&exp, 2); + expn.X_op = O_constant; + expn.X_add_number = c; + emit_expr (&expn, 2); } /* Walk backwards in the frag chain. */ @@ -298,14 +298,14 @@ frag_bit_offset (fragS *frag, segT seg) expression. */ static char * -parse_expression (char *str, expressionS *exp) +parse_expression (char *str, expressionS *expn) { char *s; char *tmp; tmp = input_line_pointer; /* Save line pointer. */ input_line_pointer = str; - expression (exp); + expression (expn); s = input_line_pointer; input_line_pointer = tmp; /* Restore line pointer. */ return s; /* Return pointer to where parsing stopped. */ @@ -1018,12 +1018,12 @@ tic54x_cons (int type) } else { - expressionS exp; + expressionS expn; - input_line_pointer = parse_expression (input_line_pointer, &exp); - if (exp.X_op == O_constant) + input_line_pointer = parse_expression (input_line_pointer, &expn); + if (expn.X_op == O_constant) { - offsetT value = exp.X_add_number; + offsetT value = expn.X_add_number; /* Truncate overflows. */ switch (octets) { @@ -1039,7 +1039,7 @@ tic54x_cons (int type) break; } } - if (exp.X_op != O_constant && octets < 2) + if (expn.X_op != O_constant && octets < 2) { /* Disallow .byte with a non constant expression that will require relocation. */ @@ -1048,7 +1048,7 @@ tic54x_cons (int type) return; } - if (exp.X_op != O_constant + if (expn.X_op != O_constant && amode == c_mode && octets == 4) { @@ -1059,14 +1059,14 @@ tic54x_cons (int type) totally ignored in the latest tools). */ amode = far_mode; emitting_long = 1; - emit_expr (&exp, 4); + emit_expr (&expn, 4); emitting_long = 0; amode = c_mode; } else { emitting_long = octets == 4; - emit_expr (&exp, (octets == 1) ? 2 : octets); + emit_expr (&expn, (octets == 1) ? 2 : octets); emitting_long = 0; } } @@ -1222,7 +1222,7 @@ tic54x_sect (int arg) static void tic54x_space (int arg) { - expressionS exp; + expressionS expn; char *p = 0; int octets = 0; long words; @@ -1238,22 +1238,21 @@ tic54x_space (int arg) #endif /* Read the bit count. */ - expression (&exp); + expression (&expn); /* Some expressions are unresolvable until later in the assembly pass; postpone until relaxation/fixup. we also have to postpone if a previous partial allocation has not been completed yet. */ - if (exp.X_op != O_constant || frag_bit_offset (frag_now, now_seg) == -1) + if (expn.X_op != O_constant || frag_bit_offset (frag_now, now_seg) == -1) { struct bit_info *bi = xmalloc (sizeof (struct bit_info)); - char *p; bi->seg = now_seg; bi->type = bes; bi->sym = label; p = frag_var (rs_machine_dependent, 65536 * 2, 1, (relax_substateT) 0, - make_expr_symbol (&exp), (offsetT) 0, + make_expr_symbol (&expn), (offsetT) 0, (char *) bi); if (p) *p = 0; @@ -1268,7 +1267,7 @@ tic54x_space (int arg) { int spare_bits = bits_per_byte - bit_offset; - if (spare_bits >= exp.X_add_number) + if (spare_bits >= expn.X_add_number) { /* Don't have to do anything; sufficient bits have already been allocated; just point the label to the right place. */ @@ -1278,10 +1277,10 @@ tic54x_space (int arg) S_SET_VALUE (label, frag_now_fix () - 1); label = NULL; } - frag_now->tc_frag_data += exp.X_add_number; + frag_now->tc_frag_data += expn.X_add_number; goto getout; } - exp.X_add_number -= spare_bits; + expn.X_add_number -= spare_bits; /* Set the label to point to the first word allocated, which in this case is the previous word, which was only partially filled. */ if (!bes && label != NULL) @@ -1292,9 +1291,9 @@ tic54x_space (int arg) } } /* Convert bits to bytes/words and octets, rounding up. */ - words = ((exp.X_add_number + bits_per_byte - 1) / bits_per_byte); + words = ((expn.X_add_number + bits_per_byte - 1) / bits_per_byte); /* How many do we have left over? */ - bit_offset = exp.X_add_number % bits_per_byte; + bit_offset = expn.X_add_number % bits_per_byte; octets = words * OCTETS_PER_BYTE; if (octets < 0) { @@ -1695,7 +1694,7 @@ tic54x_align_words (int arg) static void tic54x_field (int ignore ATTRIBUTE_UNUSED) { - expressionS exp; + expressionS expn; int size = 16; char *p; valueT value; @@ -1707,7 +1706,7 @@ tic54x_field (int ignore ATTRIBUTE_UNUSED) return; } - input_line_pointer = parse_expression (input_line_pointer, &exp); + input_line_pointer = parse_expression (input_line_pointer, &expn); if (*input_line_pointer == ',') { @@ -1722,7 +1721,7 @@ tic54x_field (int ignore ATTRIBUTE_UNUSED) } /* Truncate values to the field width. */ - if (exp.X_op != O_constant) + if (expn.X_op != O_constant) { /* If the expression value is relocatable, the field size *must* be 16. */ @@ -1734,17 +1733,17 @@ tic54x_field (int ignore ATTRIBUTE_UNUSED) } frag_now->tc_frag_data = 0; - emit_expr (&exp, 2); + emit_expr (&expn, 2); } else { unsigned long fmask = (size == 32) ? 0xFFFFFFFF : (1ul << size) - 1; - value = exp.X_add_number; - exp.X_add_number &= fmask; - if (value != (valueT) exp.X_add_number) + value = expn.X_add_number; + expn.X_add_number &= fmask; + if (value != (valueT) expn.X_add_number) as_warn (_("field value truncated")); - value = exp.X_add_number; + value = expn.X_add_number; /* Bits are stored MS first. */ while (size >= 16) { @@ -2656,11 +2655,11 @@ subsym_ismember (char *sym, char *list) static int subsym_iscons (char *a, char *ignore ATTRIBUTE_UNUSED) { - expressionS exp; + expressionS expn; - parse_expression (a, &exp); + parse_expression (a, &expn); - if (exp.X_op == O_constant) + if (expn.X_op == O_constant) { int len = strlen (a); @@ -4570,10 +4569,10 @@ subsym_substitute (char *line, int forced) ++ptr; if (math_entry != NULL) { - float arg1, arg2 = 0; + float farg1, farg2 = 0; volatile float fresult; - arg1 = (float) strtod (ptr, &ptr); + farg1 = (float) strtod (ptr, &ptr); if (math_entry->nargs == 2) { if (*ptr++ != ',') @@ -4581,9 +4580,9 @@ subsym_substitute (char *line, int forced) as_bad (_("Expecting second argument")); break; } - arg2 = (float) strtod (ptr, &ptr); + farg2 = (float) strtod (ptr, &ptr); } - fresult = (*math_entry->proc) (arg1, arg2); + fresult = (*math_entry->proc) (farg1, farg2); value = xmalloc (128); if (math_entry->int_return) sprintf (value, "%d", (int) fresult); @@ -5080,7 +5079,7 @@ tic54x_undefined_symbol (char *name) int tic54x_parse_name (char *name ATTRIBUTE_UNUSED, - expressionS *exp ATTRIBUTE_UNUSED) + expressionS *expn ATTRIBUTE_UNUSED) { return 0; } @@ -5125,7 +5124,7 @@ tc_gen_reloc (asection *section, fixS *fixP) /* Handle cons expressions. */ void -tic54x_cons_fix_new (fragS *frag, int where, int octets, expressionS *exp) +tic54x_cons_fix_new (fragS *frag, int where, int octets, expressionS *expn) { bfd_reloc_code_real_type r; @@ -5148,7 +5147,7 @@ tic54x_cons_fix_new (fragS *frag, int where, int octets, expressionS *exp) r = BFD_RELOC_32; break; } - fix_new_exp (frag, where, octets, exp, 0, r); + fix_new_exp (frag, where, octets, expn, 0, r); } /* Attempt to simplify or even eliminate a fixup. diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index 2ed8ada..efb527b 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -1826,6 +1826,7 @@ expression_maybe_register (xtensa_opcode opc, int opnd, expressionS *tok) { bfd_reloc_code_real_type reloc; segT t = expression (tok); + if (t == absolute_section && xtensa_operand_is_PCrelative (isa, opc, opnd) == 1) { @@ -3235,15 +3236,16 @@ xg_immeds_fit (const TInsn *insn) gas_assert (insn->insn_type == ITYPE_INSN); for (i = 0; i < n; ++i) { - const expressionS *expr = &insn->tok[i]; + const expressionS *exp = &insn->tok[i]; + if (xtensa_operand_is_register (isa, insn->opcode, i) == 1) continue; - switch (expr->X_op) + switch (exp->X_op) { case O_register: case O_constant: - if (xg_check_operand (expr->X_add_number, insn->opcode, i)) + if (xg_check_operand (exp->X_add_number, insn->opcode, i)) return FALSE; break; @@ -3279,15 +3281,16 @@ xg_symbolic_immeds_fit (const TInsn *insn, for (i = 0; i < n; ++i) { - const expressionS *expr = &insn->tok[i]; + const expressionS *exp = &insn->tok[i]; + if (xtensa_operand_is_register (isa, insn->opcode, i) == 1) continue; - switch (expr->X_op) + switch (exp->X_op) { case O_register: case O_constant: - if (xg_check_operand (expr->X_add_number, insn->opcode, i)) + if (xg_check_operand (exp->X_add_number, insn->opcode, i)) return FALSE; break; @@ -3307,8 +3310,8 @@ xg_symbolic_immeds_fit (const TInsn *insn, /* If it is a weak symbol or a symbol in a different section, it cannot be known to fit at assembly time. */ - if (S_IS_WEAK (expr->X_add_symbol) - || S_GET_SEGMENT (expr->X_add_symbol) != pc_seg) + if (S_IS_WEAK (exp->X_add_symbol) + || S_GET_SEGMENT (exp->X_add_symbol) != pc_seg) { /* For a direct call with --no-longcalls, be optimistic and assume it will be in range. If the symbol is weak and @@ -3318,16 +3321,16 @@ xg_symbolic_immeds_fit (const TInsn *insn, symbols even if longcalls is not enabled. */ if (is_direct_call_opcode (insn->opcode) && ! pc_frag->tc_frag_data.use_longcalls - && (! S_IS_WEAK (expr->X_add_symbol) - || S_IS_DEFINED (expr->X_add_symbol))) + && (! S_IS_WEAK (exp->X_add_symbol) + || S_IS_DEFINED (exp->X_add_symbol))) return TRUE; return FALSE; } - symbolP = expr->X_add_symbol; + symbolP = exp->X_add_symbol; sym_frag = symbol_get_frag (symbolP); - target = S_GET_VALUE (symbolP) + expr->X_add_number; + target = S_GET_VALUE (symbolP) + exp->X_add_number; pc = pc_frag->fr_address + pc_offset; /* If frag has yet to be reached on this pass, assume it @@ -3568,11 +3571,11 @@ xg_expand_to_stack (IStack *istack, TInsn *insn, int lateral_steps) /* Check to see if it fits. */ for (i = stack_size; i < istack->ninsn; i++) { - TInsn *insn = &istack->insn[i]; + TInsn *tinsn = &istack->insn[i]; - if (insn->insn_type == ITYPE_INSN - && !tinsn_has_symbolic_operands (insn) - && !xg_immeds_fit (insn)) + if (tinsn->insn_type == ITYPE_INSN + && !tinsn_has_symbolic_operands (tinsn) + && !xg_immeds_fit (tinsn)) { istack->ninsn = stack_size; return FALSE; @@ -4192,7 +4195,7 @@ xg_add_opcode_fix (TInsn *tinsn, int opnum, xtensa_format fmt, int slot, - expressionS *expr, + expressionS *exp, fragS *fragP, offsetT offset) { @@ -4212,15 +4215,15 @@ xg_add_opcode_fix (TInsn *tinsn, } else if (opcode == xtensa_const16_opcode) { - if (expr->X_op == O_lo16) + if (exp->X_op == O_lo16) { reloc = encode_reloc (slot); - expr->X_op = O_symbol; + exp->X_op = O_symbol; } - else if (expr->X_op == O_hi16) + else if (exp->X_op == O_hi16) { reloc = encode_alt_reloc (slot); - expr->X_op = O_symbol; + exp->X_op = O_symbol; } } @@ -4234,7 +4237,7 @@ xg_add_opcode_fix (TInsn *tinsn, /* Handle erroneous "@h" and "@l" expressions here before they propagate into the symbol table where the generic portions of the assembler won't know what to do with them. */ - if (expr->X_op == O_lo16 || expr->X_op == O_hi16) + if (exp->X_op == O_lo16 || exp->X_op == O_hi16) { as_bad (_("invalid expression for operand %i of '%s'"), opnum + 1, xtensa_opcode_name (xtensa_default_isa, opcode)); @@ -4259,11 +4262,11 @@ xg_add_opcode_fix (TInsn *tinsn, } fmt_length = xtensa_format_length (xtensa_default_isa, fmt); - the_fix = fix_new_exp (fragP, offset, fmt_length, expr, + the_fix = fix_new_exp (fragP, offset, fmt_length, exp, howto->pc_relative, reloc); the_fix->fx_no_overflow = 1; - the_fix->tc_fix_data.X_add_symbol = expr->X_add_symbol; - the_fix->tc_fix_data.X_add_number = expr->X_add_number; + the_fix->tc_fix_data.X_add_symbol = exp->X_add_symbol; + the_fix->tc_fix_data.X_add_number = exp->X_add_number; the_fix->tc_fix_data.slot = slot; return TRUE; @@ -7349,12 +7352,12 @@ static offsetT unrelaxed_frag_max_size (fragS *); static bfd_boolean is_narrow_branch_guaranteed_in_range (fragS *fragP, TInsn *tinsn) { - const expressionS *expr = &tinsn->tok[1]; - symbolS *symbolP = expr->X_add_symbol; - offsetT max_distance = expr->X_add_number; + const expressionS *exp = &tinsn->tok[1]; + symbolS *symbolP = exp->X_add_symbol; + offsetT max_distance = exp->X_add_number; fragS *target_frag; - if (expr->X_op != O_symbol) + if (exp->X_op != O_symbol) return FALSE; target_frag = symbol_get_frag (symbolP); @@ -7441,12 +7444,12 @@ xtensa_mark_difference_of_two_symbols (void) for (expr_sym = expr_symbols; expr_sym; expr_sym = symbol_get_tc (expr_sym)->next_expr_symbol) { - expressionS *expr = symbol_get_value_expression (expr_sym); + expressionS *exp = symbol_get_value_expression (expr_sym); - if (expr->X_op == O_subtract) + if (exp->X_op == O_subtract) { - symbolS *left = expr->X_add_symbol; - symbolS *right = expr->X_op_symbol; + symbolS *left = exp->X_add_symbol; + symbolS *right = exp->X_op_symbol; /* Difference of two symbols not in the same section are handled with relocations in the linker. */ @@ -8083,7 +8086,7 @@ xtensa_sanity_check (void) static bfd_boolean is_empty_loop (const TInsn *insn, fragS *fragP) { - const expressionS *expr; + const expressionS *exp; symbolS *symbolP; fragS *next_fragP; @@ -8096,12 +8099,12 @@ is_empty_loop (const TInsn *insn, fragS *fragP) if (insn->ntok <= LOOP_IMMED_OPN) return FALSE; - expr = &insn->tok[LOOP_IMMED_OPN]; + exp = &insn->tok[LOOP_IMMED_OPN]; - if (expr->X_op != O_symbol) + if (exp->X_op != O_symbol) return FALSE; - symbolP = expr->X_add_symbol; + symbolP = exp->X_add_symbol; if (!symbolP) return FALSE; @@ -8130,7 +8133,7 @@ is_empty_loop (const TInsn *insn, fragS *fragP) static bfd_boolean is_local_forward_loop (const TInsn *insn, fragS *fragP) { - const expressionS *expr; + const expressionS *exp; symbolS *symbolP; fragS *next_fragP; @@ -8143,12 +8146,12 @@ is_local_forward_loop (const TInsn *insn, fragS *fragP) if (insn->ntok <= LOOP_IMMED_OPN) return FALSE; - expr = &insn->tok[LOOP_IMMED_OPN]; + exp = &insn->tok[LOOP_IMMED_OPN]; - if (expr->X_op != O_symbol) + if (exp->X_op != O_symbol) return FALSE; - symbolP = expr->X_add_symbol; + symbolP = exp->X_add_symbol; if (!symbolP) return FALSE; @@ -10167,9 +10170,9 @@ xtensa_move_literals (void) for (lit = literal_syms; lit; lit = lit->next) { symbolS *lit_sym = lit->sym; - segT dest_seg = symbol_get_frag (lit_sym)->tc_frag_data.lit_seg; - if (dest_seg) - S_SET_SEGMENT (lit_sym, dest_seg); + segT dseg = symbol_get_frag (lit_sym)->tc_frag_data.lit_seg; + if (dseg) + S_SET_SEGMENT (lit_sym, dseg); } } @@ -11401,20 +11404,20 @@ tinsn_to_slotbuf (xtensa_format fmt, for (i = 0; i < noperands; i++) { - expressionS *expr = &tinsn->tok[i]; + expressionS *exp = &tinsn->tok[i]; int rc; unsigned line; char *file_name; uint32 opnd_value; - switch (expr->X_op) + switch (exp->X_op) { case O_register: if (xtensa_operand_is_visible (isa, opcode, i) == 0) break; /* The register number has already been checked in expression_maybe_register, so we don't need to check here. */ - opnd_value = expr->X_add_number; + opnd_value = exp->X_add_number; (void) xtensa_operand_encode (isa, opcode, i, &opnd_value); rc = xtensa_operand_set_field (isa, opcode, i, fmt, slot, slotbuf, opnd_value); @@ -11429,7 +11432,7 @@ tinsn_to_slotbuf (xtensa_format fmt, /* It is a constant and we called this function then we have to try to fit it. */ xtensa_insnbuf_set_operand (slotbuf, fmt, slot, opcode, i, - expr->X_add_number, file_name, line); + exp->X_add_number, file_name, line); break; default: @@ -11783,8 +11786,8 @@ vinsn_to_insnbuf (vliw_insn *vinsn, for (i = 0; i < noperands; i++) { - expressionS* expr = &tinsn->tok[i]; - switch (expr->X_op) + expressionS* exp = &tinsn->tok[i]; + switch (exp->X_op) { case O_symbol: case O_lo16: @@ -11799,15 +11802,15 @@ vinsn_to_insnbuf (vliw_insn *vinsn, || tinsn->is_specific_opcode || !xg_is_relaxable_insn (tinsn, 0)) { - xg_add_opcode_fix (tinsn, i, fmt, slot, expr, fragP, + xg_add_opcode_fix (tinsn, i, fmt, slot, exp, fragP, frag_offset - fragP->fr_literal); } else { - if (expr->X_op != O_symbol) + if (exp->X_op != O_symbol) as_bad (_("invalid operand")); - tinsn->symbol = expr->X_add_symbol; - tinsn->offset = expr->X_add_number; + tinsn->symbol = exp->X_add_symbol; + tinsn->offset = exp->X_add_number; } } else diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c index a66ae90..7cc061a 100644 --- a/gas/config/tc-z8k.c +++ b/gas/config/tc-z8k.c @@ -203,7 +203,7 @@ static int the_interrupt; number. */ static char * -whatreg (unsigned int *reg, char *src) +whatreg (unsigned int *preg, char *src) { unsigned int new_reg; @@ -222,7 +222,7 @@ whatreg (unsigned int *reg, char *src) if (src[0] != 0 && src[0] != ',' && src[0] != '(' && src[0] != ')') return NULL; - *reg = new_reg; + *preg = new_reg; return src; } @@ -244,7 +244,7 @@ whatreg (unsigned int *reg, char *src) in SRC after the reg name. */ static char * -parse_reg (char *src, int *mode, unsigned int *reg) +parse_reg (char *src, int *mode, unsigned int *preg) { char *res = NULL; char regno; @@ -257,12 +257,12 @@ parse_reg (char *src, int *mode, unsigned int *reg) if (segmented_mode) { *mode = CLASS_REG_LONG; - *reg = 14; + *preg = 14; } else { *mode = CLASS_REG_WORD; - *reg = 15; + *preg = 15; } return src + 2; } @@ -274,10 +274,10 @@ parse_reg (char *src, int *mode, unsigned int *reg) if (src[2] < '0' || src[2] > '9') return NULL; /* Assume no register name but a label starting with 'rr'. */ *mode = CLASS_REG_LONG; - res = whatreg (reg, src + 2); + res = whatreg (preg, src + 2); if (res == NULL) return NULL; /* Not a valid register name. */ - regno = *reg; + regno = *preg; if (regno > 14) as_bad (_("register rr%d out of range"), regno); if (regno & 1) @@ -288,10 +288,10 @@ parse_reg (char *src, int *mode, unsigned int *reg) if (src[2] < '0' || src[2] > '9') return NULL; /* Assume no register name but a label starting with 'rh'. */ *mode = CLASS_REG_BYTE; - res = whatreg (reg, src + 2); + res = whatreg (preg, src + 2); if (res == NULL) return NULL; /* Not a valid register name. */ - regno = *reg; + regno = *preg; if (regno > 7) as_bad (_("register rh%d out of range"), regno); } @@ -300,23 +300,23 @@ parse_reg (char *src, int *mode, unsigned int *reg) if (src[2] < '0' || src[2] > '9') return NULL; /* Assume no register name but a label starting with 'rl'. */ *mode = CLASS_REG_BYTE; - res = whatreg (reg, src + 2); + res = whatreg (preg, src + 2); if (res == NULL) return NULL; /* Not a valid register name. */ - regno = *reg; + regno = *preg; if (regno > 7) as_bad (_("register rl%d out of range"), regno); - *reg += 8; + *preg += 8; } else if (src[1] == 'q' || src[1] == 'Q') { if (src[2] < '0' || src[2] > '9') return NULL; /* Assume no register name but a label starting with 'rq'. */ *mode = CLASS_REG_QUAD; - res = whatreg (reg, src + 2); + res = whatreg (preg, src + 2); if (res == NULL) return NULL; /* Not a valid register name. */ - regno = *reg; + regno = *preg; if (regno > 12) as_bad (_("register rq%d out of range"), regno); if (regno & 3) @@ -327,10 +327,10 @@ parse_reg (char *src, int *mode, unsigned int *reg) if (src[1] < '0' || src[1] > '9') return NULL; /* Assume no register name but a label starting with 'r'. */ *mode = CLASS_REG_WORD; - res = whatreg (reg, src + 1); + res = whatreg (preg, src + 1); if (res == NULL) return NULL; /* Not a valid register name. */ - regno = *reg; + regno = *preg; if (regno > 15) as_bad (_("register r%d out of range"), regno); } diff --git a/gas/configure b/gas/configure index f6bbc97..cbcffc7 100755 --- a/gas/configure +++ b/gas/configure @@ -11446,7 +11446,7 @@ fi using_cgen=no -GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" +GCC_WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow" # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : diff --git a/gas/doc/Makefile.in b/gas/doc/Makefile.in index 74bdb7e..c148176 100644 --- a/gas/doc/Makefile.in +++ b/gas/doc/Makefile.in @@ -39,12 +39,15 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(as_TEXINFOS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \ + $(top_srcdir)/../config/zlib.m4 \ $(top_srcdir)/../bfd/warning.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/gettext-sister.m4 \ + $(top_srcdir)/../config/largefile.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/nls.m4 \ $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../config/plugins.m4 \ $(top_srcdir)/../config/po.m4 \ $(top_srcdir)/../config/progtest.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c index dfe24af..93e011f 100644 --- a/gas/dw2gencfi.c +++ b/gas/dw2gencfi.c @@ -1716,7 +1716,6 @@ cfi_finish (void) for (fde = all_fde_data; fde ; fde = fde->next) { struct cfi_insn_data *first; - struct cie_entry *cie; if (fde->end_address == NULL) { diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index 42d7267..4061c72 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -216,12 +216,12 @@ static unsigned int get_filenum (const char *, unsigned int); static void generic_dwarf2_emit_offset (symbolS *symbol, unsigned int size) { - expressionS expr; + expressionS exp; - expr.X_op = O_symbol; - expr.X_add_symbol = symbol; - expr.X_add_number = 0; - emit_expr (&expr, size); + exp.X_op = O_symbol; + exp.X_add_symbol = symbol; + exp.X_add_number = 0; + emit_expr (&exp, size); } #endif @@ -235,7 +235,7 @@ get_line_subseg (segT seg, subsegT subseg) static struct line_subseg *last_line_subseg; struct line_seg *s; - struct line_subseg **pss, *ss; + struct line_subseg **pss, *lss; if (seg == last_seg && subseg == last_subseg) return last_line_subseg; @@ -253,27 +253,27 @@ get_line_subseg (segT seg, subsegT subseg) } gas_assert (seg == s->seg); - for (pss = &s->head; (ss = *pss) != NULL ; pss = &ss->next) + for (pss = &s->head; (lss = *pss) != NULL ; pss = &lss->next) { - if (ss->subseg == subseg) + if (lss->subseg == subseg) goto found_subseg; - if (ss->subseg > subseg) + if (lss->subseg > subseg) break; } - ss = (struct line_subseg *) xmalloc (sizeof (*ss)); - ss->next = *pss; - ss->subseg = subseg; - ss->head = NULL; - ss->ptail = &ss->head; - *pss = ss; + lss = (struct line_subseg *) xmalloc (sizeof (*lss)); + lss->next = *pss; + lss->subseg = subseg; + lss->head = NULL; + lss->ptail = &lss->head; + *pss = lss; found_subseg: last_seg = seg; last_subseg = subseg; - last_line_subseg = ss; + last_line_subseg = lss; - return ss; + return lss; } /* Record an entry for LOC occurring at LABEL. */ @@ -281,7 +281,7 @@ get_line_subseg (segT seg, subsegT subseg) static void dwarf2_gen_line_info_1 (symbolS *label, struct dwarf2_line_info *loc) { - struct line_subseg *ss; + struct line_subseg *lss; struct line_entry *e; e = (struct line_entry *) xmalloc (sizeof (*e)); @@ -289,9 +289,9 @@ dwarf2_gen_line_info_1 (symbolS *label, struct dwarf2_line_info *loc) e->label = label; e->loc = *loc; - ss = get_line_subseg (now_seg, now_subseg); - *ss->ptail = e; - ss->ptail = &e->next; + lss = get_line_subseg (now_seg, now_subseg); + *lss->ptail = e; + lss->ptail = &e->next; } /* Record an entry for LOC occurring at OFS within the current fragment. */ @@ -813,16 +813,16 @@ get_frag_fix (fragS *frag, segT seg) static void out_set_addr (symbolS *sym) { - expressionS expr; + expressionS exp; out_opcode (DW_LNS_extended_op); out_uleb128 (sizeof_address + 1); out_opcode (DW_LNE_set_address); - expr.X_op = O_symbol; - expr.X_add_symbol = sym; - expr.X_add_number = 0; - emit_expr (&expr, sizeof_address); + exp.X_op = O_symbol; + exp.X_add_symbol = sym; + exp.X_add_number = 0; + emit_expr (&exp, sizeof_address); } #if DWARF2_LINE_MIN_INSN_LENGTH > 1 @@ -1052,7 +1052,7 @@ static void emit_fixed_inc_line_addr (int line_delta, addressT addr_delta, fragS *frag, char *p, int len) { - expressionS *exp; + expressionS *pexp; segT line_seg; char *end = p + len; @@ -1067,7 +1067,7 @@ emit_fixed_inc_line_addr (int line_delta, addressT addr_delta, fragS *frag, p += output_leb128 (p, line_delta, 1); } - exp = symbol_get_value_expression (frag->fr_symbol); + pexp = symbol_get_value_expression (frag->fr_symbol); line_seg = subseg_get (".debug_line", 0); /* The DW_LNS_fixed_advance_pc opcode has a 2-byte operand so it can @@ -1078,26 +1078,26 @@ emit_fixed_inc_line_addr (int line_delta, addressT addr_delta, fragS *frag, if (addr_delta > 50000) { symbolS *to_sym; - expressionS expr; + expressionS exp; - gas_assert (exp->X_op = O_subtract); - to_sym = exp->X_add_symbol; + gas_assert (pexp->X_op = O_subtract); + to_sym = pexp->X_add_symbol; *p++ = DW_LNS_extended_op; p += output_leb128 (p, sizeof_address + 1, 0); *p++ = DW_LNE_set_address; - expr.X_op = O_symbol; - expr.X_add_symbol = to_sym; - expr.X_add_number = 0; + exp.X_op = O_symbol; + exp.X_add_symbol = to_sym; + exp.X_add_number = 0; subseg_change (line_seg, 0); - emit_expr_fix (&expr, sizeof_address, frag, p); + emit_expr_fix (&exp, sizeof_address, frag, p); p += sizeof_address; } else { *p++ = DW_LNS_fixed_advance_pc; subseg_change (line_seg, 0); - emit_expr_fix (exp, 2, frag, p); + emit_expr_fix (pexp, 2, frag, p); p += 2; } @@ -1119,13 +1119,13 @@ emit_fixed_inc_line_addr (int line_delta, addressT addr_delta, fragS *frag, static void relax_inc_line_addr (int line_delta, symbolS *to_sym, symbolS *from_sym) { - expressionS expr; + expressionS exp; int max_chars; - expr.X_op = O_subtract; - expr.X_add_symbol = to_sym; - expr.X_op_symbol = from_sym; - expr.X_add_number = 0; + exp.X_op = O_subtract; + exp.X_add_symbol = to_sym; + exp.X_op_symbol = from_sym; + exp.X_add_number = 0; /* The maximum size of the frag is the line delta with a maximum sized address delta. */ @@ -1136,7 +1136,7 @@ relax_inc_line_addr (int line_delta, symbolS *to_sym, symbolS *from_sym) max_chars = size_inc_line_addr (line_delta, -DWARF2_LINE_MIN_INSN_LENGTH); frag_var (rs_dwarf2dbg, max_chars, max_chars, 1, - make_expr_symbol (&expr), line_delta, NULL); + make_expr_symbol (&exp), line_delta, NULL); } /* The function estimates the size of a rs_dwarf2dbg variant frag @@ -1368,7 +1368,7 @@ out_file_list (void) to the end of the section. */ static int -out_header (asection *sec, expressionS *expr) +out_header (asection *sec, expressionS *exp) { symbolS *start_sym; symbolS *end_sym; @@ -1378,26 +1378,26 @@ out_header (asection *sec, expressionS *expr) end_sym = symbol_temp_make (); /* Total length of the information. */ - expr->X_op = O_subtract; - expr->X_add_symbol = end_sym; - expr->X_op_symbol = start_sym; + exp->X_op = O_subtract; + exp->X_add_symbol = end_sym; + exp->X_op_symbol = start_sym; switch (DWARF2_FORMAT (sec)) { case dwarf2_format_32bit: - expr->X_add_number = -4; - emit_expr (expr, 4); + exp->X_add_number = -4; + emit_expr (exp, 4); return 4; case dwarf2_format_64bit: - expr->X_add_number = -12; + exp->X_add_number = -12; out_four (-1); - emit_expr (expr, 8); + emit_expr (exp, 8); return 8; case dwarf2_format_64bit_irix: - expr->X_add_number = -8; - emit_expr (expr, 8); + exp->X_add_number = -8; + emit_expr (exp, 8); return 8; } @@ -1410,23 +1410,23 @@ out_header (asection *sec, expressionS *expr) static void out_debug_line (segT line_seg) { - expressionS expr; + expressionS exp; symbolS *prologue_end; symbolS *line_end; struct line_seg *s; int sizeof_offset; - sizeof_offset = out_header (line_seg, &expr); - line_end = expr.X_add_symbol; + sizeof_offset = out_header (line_seg, &exp); + line_end = exp.X_add_symbol; /* Version. */ out_two (2); /* Length of the prologue following this length. */ prologue_end = symbol_temp_make (); - expr.X_add_symbol = prologue_end; - expr.X_add_number = - (4 + 2 + 4); - emit_expr (&expr, sizeof_offset); + exp.X_add_symbol = prologue_end; + exp.X_add_number = - (4 + 2 + 4); + emit_expr (&exp, sizeof_offset); /* Parameters of the state machine. */ out_byte (DWARF2_LINE_MIN_INSN_LENGTH); @@ -1465,7 +1465,7 @@ out_debug_ranges (segT ranges_seg) { unsigned int addr_size = sizeof_address; struct line_seg *s; - expressionS expr; + expressionS exp; unsigned int i; subseg_set (ranges_seg, 0); @@ -1490,15 +1490,15 @@ out_debug_ranges (segT ranges_seg) end = symbol_temp_new (s->seg, get_frag_fix (frag, s->seg), frag); s->text_end = end; - expr.X_op = O_symbol; - expr.X_add_symbol = beg; - expr.X_add_number = 0; - emit_expr (&expr, addr_size); + exp.X_op = O_symbol; + exp.X_add_symbol = beg; + exp.X_add_number = 0; + emit_expr (&exp, addr_size); - expr.X_op = O_symbol; - expr.X_add_symbol = end; - expr.X_add_number = 0; - emit_expr (&expr, addr_size); + exp.X_op = O_symbol; + exp.X_add_symbol = end; + exp.X_add_number = 0; + emit_expr (&exp, addr_size); } /* End of Range Entry. */ @@ -1515,13 +1515,13 @@ out_debug_aranges (segT aranges_seg, segT info_seg) { unsigned int addr_size = sizeof_address; struct line_seg *s; - expressionS expr; + expressionS exp; symbolS *aranges_end; char *p; int sizeof_offset; - sizeof_offset = out_header (aranges_seg, &expr); - aranges_end = expr.X_add_symbol; + sizeof_offset = out_header (aranges_seg, &exp); + aranges_end = exp.X_add_symbol; /* Version. */ out_two (2); @@ -1551,16 +1551,16 @@ out_debug_aranges (segT aranges_seg, segT info_seg) end = symbol_temp_new (s->seg, get_frag_fix (frag, s->seg), frag); s->text_end = end; - expr.X_op = O_symbol; - expr.X_add_symbol = beg; - expr.X_add_number = 0; - emit_expr (&expr, addr_size); + exp.X_op = O_symbol; + exp.X_add_symbol = beg; + exp.X_add_number = 0; + emit_expr (&exp, addr_size); - expr.X_op = O_subtract; - expr.X_add_symbol = end; - expr.X_op_symbol = beg; - expr.X_add_number = 0; - emit_expr (&expr, addr_size); + exp.X_op = O_subtract; + exp.X_add_symbol = end; + exp.X_op_symbol = beg; + exp.X_add_number = 0; + emit_expr (&exp, addr_size); } p = frag_more (2 * addr_size); @@ -1617,14 +1617,14 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT ranges_seg) char producer[128]; const char *comp_dir; const char *dirname; - expressionS expr; + expressionS exp; symbolS *info_end; char *p; int len; int sizeof_offset; - sizeof_offset = out_header (info_seg, &expr); - info_end = expr.X_add_symbol; + sizeof_offset = out_header (info_seg, &exp); + info_end = exp.X_add_symbol; /* DWARF version. */ out_two (2); @@ -1647,16 +1647,16 @@ out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg, segT ranges_seg) if (all_segs->next == NULL) { /* DW_AT_low_pc */ - expr.X_op = O_symbol; - expr.X_add_symbol = all_segs->text_start; - expr.X_add_number = 0; - emit_expr (&expr, sizeof_address); + exp.X_op = O_symbol; + exp.X_add_symbol = all_segs->text_start; + exp.X_add_number = 0; + emit_expr (&exp, sizeof_address); /* DW_AT_high_pc */ - expr.X_op = O_symbol; - expr.X_add_symbol = all_segs->text_end; - expr.X_add_number = 0; - emit_expr (&expr, sizeof_address); + exp.X_op = O_symbol; + exp.X_add_symbol = all_segs->text_end; + exp.X_add_number = 0; + emit_expr (&exp, sizeof_address); } else { @@ -1750,13 +1750,13 @@ dwarf2_finish (void) /* For each subsection, chain the debug entries together. */ for (s = all_segs; s; s = s->next) { - struct line_subseg *ss = s->head; - struct line_entry **ptail = ss->ptail; + struct line_subseg *lss = s->head; + struct line_entry **ptail = lss->ptail; - while ((ss = ss->next) != NULL) + while ((lss = lss->next) != NULL) { - *ptail = ss->head; - ptail = ss->ptail; + *ptail = lss->head; + ptail = lss->ptail; } } @@ -1587,13 +1587,13 @@ operatorf (int *num_chars) if (is_name_beginner (c)) { char *name = input_line_pointer; - char c = get_symbol_end (); + char ec = get_symbol_end (); - ret = md_operator (name, 2, &c); + ret = md_operator (name, 2, &ec); switch (ret) { case O_absent: - *input_line_pointer = c; + *input_line_pointer = ec; input_line_pointer = name; break; case O_uminus: @@ -1603,7 +1603,7 @@ operatorf (int *num_chars) ret = O_illegal; /* FALLTHROUGH */ default: - *input_line_pointer = c; + *input_line_pointer = ec; *num_chars = input_line_pointer - name; input_line_pointer = name; return ret; @@ -1,6 +1,6 @@ /* hash.c -- gas hash table code Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, - 2000, 2001, 2002, 2003, 2005, 2007, 2008 + 2000, 2001, 2002, 2003, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -90,16 +90,16 @@ get_gas_hash_table_size (void) { 1021, 4051, 8599, 16699, 65537 }; - unsigned int index; + unsigned int hindex; /* Work out the best prime number near the hash_size. FIXME: This could be a more sophisticated algorithm, but is it really worth implementing it ? */ - for (index = 0; index < ARRAY_SIZE (hash_size_primes) - 1; ++index) - if (gas_hash_table_size <= hash_size_primes[index]) + for (hindex = 0; hindex < ARRAY_SIZE (hash_size_primes) - 1; ++ hindex) + if (gas_hash_table_size <= hash_size_primes[hindex]) break; - return hash_size_primes[index]; + return hash_size_primes[hindex]; } /* Create a hash table. This return a control block. */ @@ -157,7 +157,7 @@ hash_lookup (struct hash_control *table, const char *key, size_t len, unsigned long hash; size_t n; unsigned int c; - unsigned int index; + unsigned int hindex; struct hash_entry **list; struct hash_entry *p; struct hash_entry *prev; @@ -179,8 +179,8 @@ hash_lookup (struct hash_control *table, const char *key, size_t len, if (phash != NULL) *phash = hash; - index = hash % table->size; - list = table->table + index; + hindex = hash % table->size; + list = table->table + hindex; if (plist != NULL) *plist = list; @@ -223,7 +223,7 @@ hash_lookup (struct hash_control *table, const char *key, size_t len, hash table. */ const char * -hash_insert (struct hash_control *table, const char *key, void *value) +hash_insert (struct hash_control *table, const char *key, void *val) { struct hash_entry *p; struct hash_entry **list; @@ -240,7 +240,7 @@ hash_insert (struct hash_control *table, const char *key, void *value) p = (struct hash_entry *) obstack_alloc (&table->memory, sizeof (*p)); p->string = key; p->hash = hash; - p->data = value; + p->data = val; p->next = *list; *list = p; @@ -253,7 +253,7 @@ hash_insert (struct hash_control *table, const char *key, void *value) error. If an entry already exists, its value is replaced. */ const char * -hash_jam (struct hash_control *table, const char *key, void *value) +hash_jam (struct hash_control *table, const char *key, void *val) { struct hash_entry *p; struct hash_entry **list; @@ -266,7 +266,7 @@ hash_jam (struct hash_control *table, const char *key, void *value) ++table->replacements; #endif - p->data = value; + p->data = val; } else { @@ -277,7 +277,7 @@ hash_jam (struct hash_control *table, const char *key, void *value) p = (struct hash_entry *) obstack_alloc (&table->memory, sizeof (*p)); p->string = key; p->hash = hash; - p->data = value; + p->data = val; p->next = *list; *list = p; diff --git a/gas/listing.c b/gas/listing.c index 25178b3..93f2b37 100644 --- a/gas/listing.c +++ b/gas/listing.c @@ -1043,9 +1043,9 @@ print_source (file_info_type * current_file, while (current_file->linenum < list->hll_line && !current_file->at_end) { - cached_line * cache = cached_lines + next_free_line; char *p; + cache = cached_lines + next_free_line; cache->file = current_file; cache->line = current_file->linenum; cache->buffer[0] = 0; diff --git a/gas/macro.c b/gas/macro.c index f77be59..b5c1824 100644 --- a/gas/macro.c +++ b/gas/macro.c @@ -75,14 +75,14 @@ static int macro_number; void macro_init (int alternate, int mri, int strip_at, - int (*expr) (const char *, int, sb *, int *)) + int (*exp) (const char *, int, sb *, int *)) { macro_hash = hash_new (); macro_defined = 0; macro_alternate = alternate; macro_mri = mri; macro_strip_at = strip_at; - macro_expr = expr; + macro_expr = exp; } /* Switch in and out of alternate mode on the fly. */ @@ -1204,7 +1204,7 @@ check_macro (const char *line, sb *expand, const char **error, macro_entry **info) { const char *s; - char *copy, *cs; + char *copy, *cls; macro_entry *macro; sb line_sb; @@ -1221,8 +1221,8 @@ check_macro (const char *line, sb *expand, copy = (char *) alloca (s - line + 1); memcpy (copy, line, s - line); copy[s - line] = '\0'; - for (cs = copy; *cs != '\0'; cs++) - *cs = TOLOWER (*cs); + for (cls = copy; *cls != '\0'; cls ++) + *cls = TOLOWER (*cls); macro = (macro_entry *) hash_find (macro_hash, copy); @@ -589,9 +589,9 @@ try_macro (char term, const char *line) void read_a_source_file (char *name) { - register char c; - register char *s; /* String of symbol, '\0' appended. */ - register int temp; + char c; + char *s; /* String of symbol, '\0' appended. */ + int temp; pseudo_typeS *pop; #ifdef WARN_COMMENTS @@ -680,7 +680,6 @@ read_a_source_file (char *name) if (is_name_beginner (*input_line_pointer)) { char *line_start = input_line_pointer; - char c; int mri_line_macro; HANDLE_CONDITIONAL_ASSEMBLY (); @@ -3198,12 +3197,12 @@ s_space (int mult) } else if (mri_common_symbol != NULL) { - valueT val; + valueT mri_val; - val = S_GET_VALUE (mri_common_symbol); - if ((val & 1) != 0) + mri_val = S_GET_VALUE (mri_common_symbol); + if ((mri_val & 1) != 0) { - S_SET_VALUE (mri_common_symbol, val + 1); + S_SET_VALUE (mri_common_symbol, mri_val + 1); if (line_label != NULL) { expressionS *symexp; diff --git a/gas/stabs.c b/gas/stabs.c index da399ad..d19bf2b 100644 --- a/gas/stabs.c +++ b/gas/stabs.c @@ -1,6 +1,6 @@ /* Generic stabs parsing for gas. Copyright 1989, 1990, 1991, 1993, 1995, 1996, 1997, 1998, 2000, 2001 - 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -517,7 +517,7 @@ generate_asm_file (int type, char *file) char sym[30]; char *buf; char *tmp = file; - char *endp = file + strlen (file); + char *file_endp = file + strlen (file); char *bufp; if (last_file != NULL @@ -540,7 +540,7 @@ generate_asm_file (int type, char *file) *bufp++ = '"'; - while (tmp < endp) + while (tmp < file_endp) { char *bslash = strchr (tmp, '\\'); size_t len = (bslash) ? (size_t) (bslash - tmp + 1) : strlen (tmp); diff --git a/gas/symbols.c b/gas/symbols.c index 5eda2cb..9202a9b 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -188,7 +188,7 @@ static unsigned long local_symbol_conversion_count; /* Create a local symbol and insert it into the local hash table. */ static struct local_symbol * -local_symbol_make (const char *name, segT section, valueT value, fragS *frag) +local_symbol_make (const char *name, segT section, valueT val, fragS *frag) { char *name_copy; struct local_symbol *ret; @@ -202,7 +202,7 @@ local_symbol_make (const char *name, segT section, valueT value, fragS *frag) ret->lsy_name = name_copy; ret->lsy_section = section; local_symbol_set_frag (ret, frag); - ret->lsy_value = value; + ret->lsy_value = val; hash_jam (local_hash, name_copy, (void *) ret); @@ -1484,21 +1484,21 @@ snapshot_symbol (symbolS **symbolPP, valueT *valueP, segT *segP, fragS **fragPP) } else { - expressionS expr = symbolP->sy_value; + expressionS exp = symbolP->sy_value; - if (!symbolP->sy_resolved && expr.X_op != O_illegal) + if (!symbolP->sy_resolved && exp.X_op != O_illegal) { int resolved; if (symbolP->sy_resolving) return 0; symbolP->sy_resolving = 1; - resolved = resolve_expression (&expr); + resolved = resolve_expression (&exp); symbolP->sy_resolving = 0; if (!resolved) return 0; - switch (expr.X_op) + switch (exp.X_op) { case O_constant: case O_register: @@ -1507,7 +1507,7 @@ snapshot_symbol (symbolS **symbolPP, valueT *valueP, segT *segP, fragS **fragPP) /* Fall thru. */ case O_symbol: case O_symbol_rva: - symbolP = expr.X_add_symbol; + symbolP = exp.X_add_symbol; break; default: return 0; @@ -1515,12 +1515,12 @@ snapshot_symbol (symbolS **symbolPP, valueT *valueP, segT *segP, fragS **fragPP) } *symbolPP = symbolP; - *valueP = expr.X_add_number; + *valueP = exp.X_add_number; *segP = symbolP->bsym->section; *fragPP = symbolP->sy_frag; if (*segP == expr_section) - switch (expr.X_op) + switch (exp.X_op) { case O_constant: *segP = absolute_section; break; case O_register: *segP = reg_section; break; @@ -1862,17 +1862,17 @@ decode_local_label_name (char *s) int instance_number; char *type; const char *message_format; - int index = 0; + int lindex = 0; #ifdef LOCAL_LABEL_PREFIX - if (s[index] == LOCAL_LABEL_PREFIX) - ++index; + if (s[lindex] == LOCAL_LABEL_PREFIX) + ++lindex; #endif - if (s[index] != 'L') + if (s[lindex] != 'L') return s; - for (label_number = 0, p = s + index + 1; ISDIGIT (*p); ++p) + for (label_number = 0, p = s + lindex + 1; ISDIGIT (*p); ++p) label_number = (10 * label_number) + *p - '0'; if (*p == DOLLAR_LABEL_CHAR) diff --git a/gas/write.c b/gas/write.c index 8adb87b..1ded21f 100644 --- a/gas/write.c +++ b/gas/write.c @@ -1787,22 +1787,24 @@ write_object_file (void) if (symbol_equated_reloc_p (symp) || S_IS_WEAKREFR (symp)) { - const char *name = S_GET_NAME (symp); + const char *sname = S_GET_NAME (symp); + if (S_IS_COMMON (symp) - && !TC_FAKE_LABEL (name) + && !TC_FAKE_LABEL (sname) && !S_IS_WEAKREFR (symp) && (!S_IS_EXTERNAL (symp) || S_IS_LOCAL (symp))) { expressionS *e = symbol_get_value_expression (symp); + as_bad (_("Local symbol `%s' can't be equated to common symbol `%s'"), - name, S_GET_NAME (e->X_add_symbol)); + sname, S_GET_NAME (e->X_add_symbol)); } if (S_GET_SEGMENT (symp) == reg_section) { /* Report error only if we know the symbol name. */ if (S_GET_NAME (symp) != reg_section->name) as_bad (_("can't make global register symbol `%s'"), - name); + sname); } symbol_remove (symp, &symbol_rootP, &symbol_lastP); continue; |