Fix more unused variable warnings
diff --git a/gas/config/tc-cr16.c b/gas/config/tc-cr16.c
index 99bc1bd..f2d1108 100644
--- a/gas/config/tc-cr16.c
+++ b/gas/config/tc-cr16.c
@@ -119,7 +119,6 @@
 static void
 l_cons (int nbytes)
 {
-  int c;
   expressionS exp;
 
 #ifdef md_flush_pending_output
@@ -141,7 +140,6 @@
   md_cons_align (nbytes);
 #endif
 
-  c = 0;
   do
     {
       unsigned int bits_available = BITS_PER_CHAR * nbytes;
@@ -236,7 +234,6 @@
       if ((*(input_line_pointer) == '@') && (*(input_line_pointer +1) == 'c'))
 	code_label = 1;
       emit_expr (&exp, nbytes);
-      ++c;
       if ((*(input_line_pointer) == '@') && (*(input_line_pointer +1) == 'c'))
 	{
 	  input_line_pointer +=3;
diff --git a/gas/config/tc-mn10200.c b/gas/config/tc-mn10200.c
index 1eb4702..fe54d21 100644
--- a/gas/config/tc-mn10200.c
+++ b/gas/config/tc-mn10200.c
@@ -896,7 +896,6 @@
   for (;;)
     {
       const char *errmsg = NULL;
-      int op_idx;
       char *hold;
       int extra_shift = 0;
 
@@ -906,9 +905,9 @@
       next_opindex = 0;
       insn = opcode->opcode;
       extension = 0;
-      for (op_idx = 1, opindex_ptr = opcode->operands;
+      for (opindex_ptr = opcode->operands;
 	   *opindex_ptr != 0;
-	   opindex_ptr++, op_idx++)
+	   opindex_ptr++)
 	{
 	  const struct mn10200_operand *operand;
 	  expressionS ex;
diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c
index f73c3bf..176910d 100644
--- a/gas/config/tc-v850.c
+++ b/gas/config/tc-v850.c
@@ -344,15 +344,10 @@
 	  int old_subsec;
 	  char *pfrag;
 	  int align;
-	  flagword applicable;
 
 	  old_sec = now_seg;
 	  old_subsec = now_subseg;
 
-	  applicable = bfd_applicable_section_flags (stdoutput);
-
-	  applicable &= SEC_ALLOC;
-
 	  switch (area)
 	    {
 	    case SCOMMON_SECTION:
diff --git a/gas/config/tc-xgate.c b/gas/config/tc-xgate.c
index 0823ecd..4a7829f 100644
--- a/gas/config/tc-xgate.c
+++ b/gas/config/tc-xgate.c
@@ -1123,7 +1123,6 @@
   unsigned short oper_mask = 0;
   int operand_bit_length = 0;
   unsigned int operand = 0;
-  char n_operand_bits = 0;
   char first_operand_equals_second = 0;
   int i = 0;
   char c = 0;
@@ -1139,7 +1138,6 @@
 	{
 	  oper_mask <<= 1;
 	  oper_mask += 1;
-	  n_operand_bits++;
 	}
     }
 
diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c
index 2980cff..83a732f 100644
--- a/gas/config/tc-z8k.c
+++ b/gas/config/tc-z8k.c
@@ -1032,7 +1032,6 @@
 {
   unsigned char *output_ptr = buffer;
   int c;
-  int nibble;
   unsigned int *class_ptr;
 
   frag_wane (frag_now);
@@ -1044,7 +1043,7 @@
   memset (buffer, 0, sizeof (buffer));
   class_ptr = this_try->byte_info;
 
-  for (nibble = 0; (c = *class_ptr++); nibble++)
+  while ((c = *class_ptr++) != 0)
     {
 
       switch (c & CLASS_MASK)
diff --git a/gas/ecoff.c b/gas/ecoff.c
index 7411595..97b9093 100644
--- a/gas/ecoff.c
+++ b/gas/ecoff.c
@@ -3606,7 +3606,6 @@
   efdr_t *file;
   proc_t *proc;
   unsigned long c;
-  long iline;
   long totcount;
   lineno_list_t first;
   lineno_list_t *local_first_lineno = first_lineno;
@@ -3620,7 +3619,6 @@
   proc = NULL;
   last = NULL;
   c = offset;
-  iline = 0;
   totcount = 0;
 
   /* FIXME?  Now that MIPS embedded-PIC is gone, it may be safe to
@@ -3800,7 +3798,6 @@
 	  ++c;
 	}
 
-      ++iline;
       last = l;
     }
 
diff --git a/gas/write.c b/gas/write.c
index 455dc44..c56ad28 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -2242,7 +2242,7 @@
 	char *table_ptr;
 	addressT table_addr;
 	addressT from_addr, to_addr;
-	int n, m;
+	int n;
 
 	subseg_change (lie->seg, lie->subseg);
 	fragP = lie->dispfrag;
@@ -2267,9 +2267,9 @@
 	table_ptr += md_short_jump_size;
 	table_addr += md_short_jump_size;
 
-	for (m = 0;
+	for (;
 	     lie && lie->dispfrag == fragP;
-	     m++, lie = lie->next_broken_word)
+	     lie = lie->next_broken_word)
 	  {
 	    if (lie->added == 2)
 	      continue;