diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1519f27b19338c227352f2a746f65870c2028a14..7c2c1705ef7807c7bc57616069cc2369a2e91e75 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,15 @@
 2009-11-27  Jakub Jelinek  <jakub@redhat.com>
 
+	* config/i386/i386.c (ix86_emit_restore_sse_regs_using_mov): Remove
+	unused insn variable.
+	* genemit.c (output_peephole2_scratches): Only declare and initialize
+	_regs_allocated if it will be ever used.
+	* cfgloopmanip.c (create_empty_if_region_on_edge): Remove unused
+	succ_bb variable.
+	(create_empty_loop_on_edge): Remove unused freq and cnt variables.
+	* unwind-c.c (PERSONALITY_FUNCTION): Remove unused action_record
+	variable.
+
 	* opts.c (decode_options): If optimize is bigger than 255,
 	set it to 255.
 
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index 1c77141af654947f9ac69cd2e4d1c96aec41bccf..459a1fdf2bfce74452219995ca8861e5cc5cd0e3 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -541,13 +541,12 @@ edge
 create_empty_if_region_on_edge (edge entry_edge, tree condition)
 {
 
-  basic_block succ_bb, cond_bb, true_bb, false_bb, join_bb;
+  basic_block cond_bb, true_bb, false_bb, join_bb;
   edge e_true, e_false, exit_edge;
   gimple cond_stmt;
   tree simple_cond;
   gimple_stmt_iterator gsi;
 
-  succ_bb = entry_edge->dest;
   cond_bb = split_edge (entry_edge);
 
   /* Insert condition in cond_bb.  */
@@ -628,8 +627,6 @@ create_empty_loop_on_edge (edge entry_edge,
 {
   basic_block loop_header, loop_latch, succ_bb, pred_bb;
   struct loop *loop;
-  int freq;
-  gcov_type cnt;
   gimple_stmt_iterator gsi;
   gimple_seq stmts;
   gimple cond_expr;
@@ -659,9 +656,6 @@ create_empty_loop_on_edge (edge entry_edge,
   add_loop (loop, outer);
 
   /* TODO: Fix frequencies and counts.  */
-  freq = EDGE_FREQUENCY (entry_edge);
-  cnt = entry_edge->count;
-
   prob = REG_BR_PROB_BASE / 2;
 
   scale_loop_frequencies (loop, REG_BR_PROB_BASE - prob, REG_BR_PROB_BASE);
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 4d5e8a31df2b76de15916c1c6b02d326805576c8..6cbc2dc7f175ce489c3e1b5becbef9c9a580a2ab 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -8844,7 +8844,7 @@ ix86_emit_restore_sse_regs_using_mov (rtx pointer, HOST_WIDE_INT offset,
 {
   int regno;
   rtx base_address = gen_rtx_MEM (TImode, pointer);
-  rtx mem, insn;
+  rtx mem;
 
   for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
     if (SSE_REGNO_P (regno) && ix86_save_reg (regno, maybe_eh_return))
@@ -8865,7 +8865,7 @@ ix86_emit_restore_sse_regs_using_mov (rtx pointer, HOST_WIDE_INT offset,
 	  }
 	mem = adjust_address (base_address, TImode, offset);
 	set_mem_align (mem, 128);
-	insn = emit_move_insn (reg, mem);
+	emit_move_insn (reg, mem);
 	offset += 16;
 
 	ix86_add_cfa_restore_note (NULL_RTX, reg, red_offset);
diff --git a/gcc/genemit.c b/gcc/genemit.c
index d7cbd10b38e7e4289a754db6b9c5ba8104e94a23..7ac3c917067fefb8895f24142ff44847604880fb 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -1,6 +1,6 @@
 /* Generate code from machine description to emit insns as rtl.
    Copyright (C) 1987, 1988, 1991, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
-   2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -782,9 +782,7 @@ output_peephole2_scratches (rtx split)
 {
   int i;
   int insn_nr = 0;
-
-  printf ("  HARD_REG_SET _regs_allocated;\n");
-  printf ("  CLEAR_HARD_REG_SET (_regs_allocated);\n");
+  bool first = true;
 
   for (i = 0; i < XVECLEN (split, 0); i++)
     {
@@ -803,6 +801,13 @@ output_peephole2_scratches (rtx split)
 	    else if (GET_CODE (XVECEXP (split, 0, j)) != MATCH_SCRATCH)
 	      cur_insn_nr++;
 
+	  if (first)
+	    {
+	      printf ("  HARD_REG_SET _regs_allocated;\n");
+	      printf ("  CLEAR_HARD_REG_SET (_regs_allocated);\n");
+	      first = false;
+	    }
+
 	  printf ("  if ((operands[%d] = peep2_find_free_register (%d, %d, \"%s\", %smode, &_regs_allocated)) == NULL_RTX)\n\
     return NULL;\n",
 		  XINT (elt, 0),
diff --git a/gcc/unwind-c.c b/gcc/unwind-c.c
index 904d608060ac828113512d2618d40832c1e01480..86b9f55704819fd2b712196cd464d14981b162ee 100644
--- a/gcc/unwind-c.c
+++ b/gcc/unwind-c.c
@@ -120,7 +120,7 @@ PERSONALITY_FUNCTION (int version,
 #endif
 {
   lsda_header_info info;
-  const unsigned char *language_specific_data, *p, *action_record;
+  const unsigned char *language_specific_data, *p;
   _Unwind_Ptr landing_pad, ip;
   int ip_before_insn = 0;
 
@@ -181,8 +181,6 @@ PERSONALITY_FUNCTION (int version,
       /* Can never have null landing pad for sjlj -- that would have
 	 been indicated by a -1 call site index.  */
       landing_pad = (_Unwind_Ptr)cs_lp + 1;
-      if (cs_action)
-	action_record = info.action_table + cs_action - 1;
       goto found_something;
     }
 #else
@@ -205,8 +203,6 @@ PERSONALITY_FUNCTION (int version,
 	{
 	  if (cs_lp)
 	    landing_pad = info.LPStart + cs_lp;
-	  if (cs_action)
-	    action_record = info.action_table + cs_action - 1;
 	  goto found_something;
 	}
     }