diff --git a/gcc/dbgcnt.c b/gcc/dbgcnt.c
index 6a7eb34cd3ed2a8d9212ad5e0d87e8219f1eaa04..458341a53a0fb753edab8ae94a5faead7430e820 100644
--- a/gcc/dbgcnt.c
+++ b/gcc/dbgcnt.c
@@ -208,7 +208,6 @@ void
 dbg_cnt_process_opt (const char *arg)
 {
   char *str = xstrdup (arg);
-  unsigned int start = 0;
 
   auto_vec<char *> tokens;
   for (char *next = strtok (str, ","); next != NULL; next = strtok (NULL, ","))
@@ -227,7 +226,6 @@ dbg_cnt_process_opt (const char *arg)
 	  if (!dbg_cnt_process_single_pair (name, ranges[j]))
 	    break;
 	}
-      start += strlen (tokens[i]) + 1;
     }
 }
 
diff --git a/gcc/gcov.c b/gcc/gcov.c
index 829e955a63ba0970df3f950d3276d798601872b5..3672ae7a6f8e09fb65dafada68faae9969c865b4 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -843,7 +843,6 @@ get_cycles_count (line_info &linfo)
      Therefore, operating on a permuted order (i.e., non-sorted) only
      has the effect of permuting the output cycles.  */
 
-  bool loop_found = false;
   gcov_type count = 0;
   for (vector<block_info *>::iterator it = linfo.blocks.begin ();
        it != linfo.blocks.end (); it++)
@@ -851,8 +850,7 @@ get_cycles_count (line_info &linfo)
       arc_vector_t path;
       block_vector_t blocked;
       vector<block_vector_t > block_lists;
-      loop_found |= circuit (*it, path, *it, blocked, block_lists, linfo,
-			     count);
+      circuit (*it, path, *it, blocked, block_lists, linfo, count);
     }
 
   return count;
diff --git a/gcc/lto-compress.c b/gcc/lto-compress.c
index b5f4916b1395f58bb8d0669ddfb85b6421a643bf..c40a13c8446b29c6bc8654ed9b2c26b86559a62f 100644
--- a/gcc/lto-compress.c
+++ b/gcc/lto-compress.c
@@ -250,7 +250,6 @@ lto_compression_zlib (struct lto_compression_stream *stream)
   const size_t outbuf_length = Z_BUFFER_LENGTH;
   unsigned char *outbuf = (unsigned char *) xmalloc (outbuf_length);
   z_stream out_stream;
-  size_t compressed_bytes = 0;
   int status;
 
   gcc_assert (stream->is_compression);
@@ -282,7 +281,6 @@ lto_compression_zlib (struct lto_compression_stream *stream)
 
       stream->callback ((const char *) outbuf, out_bytes, stream->opaque);
       lto_stats.num_compressed_il_bytes += out_bytes;
-      compressed_bytes += out_bytes;
 
       cursor += in_bytes;
       remaining -= in_bytes;
@@ -342,7 +340,6 @@ lto_uncompression_zlib (struct lto_compression_stream *stream)
   size_t remaining = stream->bytes;
   const size_t outbuf_length = Z_BUFFER_LENGTH;
   unsigned char *outbuf = (unsigned char *) xmalloc (outbuf_length);
-  size_t uncompressed_bytes = 0;
 
   gcc_assert (!stream->is_compression);
   timevar_push (TV_IPA_LTO_DECOMPRESS);
@@ -378,7 +375,6 @@ lto_uncompression_zlib (struct lto_compression_stream *stream)
 
 	  stream->callback ((const char *) outbuf, out_bytes, stream->opaque);
 	  lto_stats.num_uncompressed_il_bytes += out_bytes;
-	  uncompressed_bytes += out_bytes;
 
 	  cursor += in_bytes;
 	  remaining -= in_bytes;
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index cbbcedf790fcf69025eb830789679ec78de01564..812bbe3f16e49f7a8e3f4095aaf098ddc4aed2e4 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -2200,7 +2200,7 @@ pch_option_mismatch (const char *option)
 /* Default version of pch_valid_p.  */
 
 const char *
-default_pch_valid_p (const void *data_p, size_t len)
+default_pch_valid_p (const void *data_p, size_t len ATTRIBUTE_UNUSED)
 {
   struct cl_option_state state;
   const char *data = (const char *)data_p;
@@ -2221,7 +2221,6 @@ default_pch_valid_p (const void *data_p, size_t len)
 
       memcpy (&tf, data, sizeof (target_flags));
       data += sizeof (target_flags);
-      len -= sizeof (target_flags);
       r = targetm.check_pch_target_flags (tf);
       if (r != NULL)
 	return r;
@@ -2233,7 +2232,6 @@ default_pch_valid_p (const void *data_p, size_t len)
 	if (memcmp (data, state.data, state.size) != 0)
 	  return pch_option_mismatch (cl_options[i].opt_text);
 	data += state.size;
-	len -= state.size;
       }
 
   return NULL;
diff --git a/libcpp/charset.c b/libcpp/charset.c
index b84a9740165d274e9ace5cacccb08e65d5195307..e4e45f6d39d4e7632da308d36c03ad9dd9b525c1 100644
--- a/libcpp/charset.c
+++ b/libcpp/charset.c
@@ -1464,7 +1464,6 @@ convert_oct (cpp_reader *pfile, const uchar *from, const uchar *limit,
   cppchar_t c, n = 0;
   size_t width = cvt.width;
   size_t mask = width_to_mask (width);
-  bool overflow = false;
 
   /* loc_reader and ranges must either be both NULL, or both be non-NULL.  */
   gcc_assert ((loc_reader != NULL) == (ranges != NULL));
@@ -1477,7 +1476,6 @@ convert_oct (cpp_reader *pfile, const uchar *from, const uchar *limit,
       from++;
       if (loc_reader)
 	char_range.m_finish = loc_reader->get_next ().m_finish;
-      overflow |= n ^ (n << 3 >> 3);
       n = (n << 3) + c - '0';
     }