This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] remove trivialy unused variables


From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>

Hi,

I thought I'd see how hard it is to enable -Wunused for gdb.  There's plenty
more warnings, but this is already a large patch.  I think all these are cases
where the variable is clearly useless and getting rid of it is an improvement,
the really nice part is this lets us get rid of a number of function calls.

I did a --enable-targets=all build successfully, ok?

Thanks!

Trev

gdb/ChangeLog:

2016-04-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* aarch64-linux-tdep.c (aarch64_linux_sigframe_init): Remove unused
	variables.
	* aarch64-tdep.c (aarch64_skip_prologue): Likewise.
	(aarch64_scan_prologue): Likewise.
	(aarch64_prologue_prev_register): Likewise.
	(aarch64_dwarf2_prev_register): Likewise.
	(pass_in_v): Likewise.
	(aarch64_push_dummy_call): Likewise.
	(aarch64_breakpoint_from_pc): Likewise.
	(aarch64_return_in_memory): Likewise.
	(aarch64_return_value): Likewise.
	(aarch64_displaced_step_b_cond): Likewise.
	(aarch64_displaced_step_cb): Likewise.
	(aarch64_displaced_step_tb): Likewise.
	(aarch64_gdbarch_init): Likewise.
	(aarch64_process_record): Likewise.
	* alpha-mdebug-tdep.c (alpha_mdebug_init_abi): Likewise.
	* alpha-tdep.c (_initialize_alpha_tdep): Likewise.
	* amd64-dicos-tdep.c (amd64_dicos_init_abi): Likewise.
	* amd64-linux-tdep.c (amd64_dtrace_parse_probe_argument): Likewise.
	* amd64-tdep.c (fixup_riprel): Likewise.
	* amd64-windows-tdep.c (amd64_windows_frame_decode_epilogue): Likewise.
	(amd64_windows_frame_decode_insns): Likewise.
	(amd64_windows_frame_cache): Likewise.
	(amd64_windows_frame_prev_register): Likewise.
	(amd64_windows_frame_this_id): Likewise.
	(amd64_windows_init_abi): Likewise.
	* arm-linux-tdep.c (arm_linux_get_syscall_number): Likewise.
	(arm_linux_get_next_pcs_syscall_next_pc): Likewise.
	* arm-symbian-tdep.c (arm_symbian_init_abi): Likewise.
	* arm-tdep.c (arm_make_epilogue_frame_cache): Likewise.
	(arm_epilogue_frame_prev_register): Likewise.
	(arm_record_vdata_transfer_insn): Likewise.
	(arm_record_exreg_ld_st_insn): Likewise.
	* auto-load.c (execute_script_contents): Likewise.
	(print_scripts): Likewise.
	* avr-tdep.c (avr_frame_prev_register): Likewise.
	(avr_push_dummy_call): Likewise.
	* bfin-linux-tdep.c (bfin_linux_sigframe_init): Likewise.
	* bfin-tdep.c (bfin_push_dummy_call): Likewise.
	(bfin_gdbarch_init): Likewise.
	* blockframe.c (find_pc_partial_function_gnu_ifunc): Likewise.
	* break-catch-throw.c (fetch_probe_arguments): Likewise.
	* breakpoint.c (breakpoint_xfer_memory): Likewise.
	(breakpoint_init_inferior): Likewise.
	(breakpoint_inserted_here_p): Likewise.
	(software_breakpoint_inserted_here_p): Likewise.
	(hardware_breakpoint_inserted_here_p): Likewise.
	(bpstat_what): Likewise.
	(break_range_command): Likewise.
	(save_breakpoints): Likewise.
	* coffread.c (coff_symfile_read): Likewise.
	* cris-tdep.c (cris_push_dummy_call): Likewise.
	(cris_scan_prologue): Likewise.
	(cris_register_size): Likewise.
	(_initialize_cris_tdep): Likewise.
	* d-exp.y: Likewise.
	* dbxread.c (dbx_read_symtab): Likewise.
	(process_one_symbol): Likewise.
	(coffstab_build_psymtabs): Likewise.
	(elfstab_build_psymtabs): Likewise.
	* dicos-tdep.c (dicos_init_abi): Likewise.
	* disasm.c (do_mixed_source_and_assembly): Likewise.
	(gdb_disassembly): Likewise.
	* dtrace-probe.c (dtrace_process_dof): Likewise.
	* dwarf2read.c (error_check_comp_unit_head): Likewise.
	(build_type_psymtabs_1): Likewise.
	(skip_one_die): Likewise.
	(process_imported_unit_die): Likewise.
	(dwarf2_physname): Likewise.
	(read_file_scope): Likewise.
	(setup_type_unit_groups): Likewise.
	(create_dwo_cu_reader): Likewise.
	(create_dwo_cu): Likewise.
	(create_dwo_unit_in_dwp_v1): Likewise.
	(create_dwo_unit_in_dwp_v2): Likewise.
	(lookup_dwo_unit_in_dwp): Likewise.
	(free_dwo_file): Likewise.
	(check_producer): Likewise.
	(dwarf2_add_typedef): Likewise.
	(dwarf2_add_member_fn): Likewise.
	(read_unsigned_leb128): Likewise.
	(read_signed_leb128): Likewise.
	(dwarf2_const_value): Likewise.
	(follow_die_sig_1): Likewise.
	(dwarf_decode_macro_bytes): Likewise.
	* extension.c (restore_active_ext_lang): Likewise.
	* frv-linux-tdep.c (frv_linux_sigtramp_frame_cache): Likewise.
	* ft32-tdep.c (ft32_analyze_prologue): Likewise.
	* gdbtypes.c (lookup_typename): Likewise.
	(resolve_dynamic_range): Likewise.
	(check_typedef): Likewise.
	* h8300-tdep.c (h8300_is_argument_spill): Likewise.
	(h8300_gdbarch_init): Likewise.
	* hppa-tdep.c (hppa32_push_dummy_call): Likewise.
	(hppa_frame_this_id): Likewise.
	(_initialize_hppa_tdep): Likewise.
	* hppanbsd-tdep.c (hppanbsd_sigtramp_cache_init): Likewise.
	* hppaobsd-tdep.c (hppaobsd_supply_fpregset): Likewise.
	* i386-dicos-tdep.c (i386_dicos_init_abi): Likewise.
	* i386-tdep.c (i386_bnd_type): Likewise.
	(i386_gdbarch_init): Likewise.
	(i386_mpx_bd_base): Likewise.
	* i386nbsd-tdep.c (i386nbsd_sigtramp_cache_init): Likewise.
	* i386obsd-tdep.c (i386obsd_elf_init_abi): Likewise.
	* ia64-tdep.c (examine_prologue): Likewise.
	(ia64_frame_cache): Likewise.
	(ia64_push_dummy_call): Likewise.
	* infcmd.c (finish_command_fsm_async_reply_reason): Likewise.
	(default_print_one_register_info): Likewise.
	* infrun.c (infrun_thread_ptid_changed): Likewise.
	(thread_still_needs_step_over): Likewise.
	(stop_all_threads): Likewise.
	(restart_threads): Likewise.
	(keep_going_stepped_thread): Likewise.
	* iq2000-tdep.c (iq2000_scan_prologue): Likewise.
	* language.c (language_init_primitive_type_symbols): Likewise.
	* linespec.c (add_sal_to_sals): Likewise.
	* linux-nat.c (status_callback): Likewise.
	(kill_unfollowed_fork_children): Likewise.
	(linux_nat_kill): Likewise.
	* linux-tdep.c (linux_fill_prpsinfo): Likewise.
	* linux-thread-db.c (thread_db_notice_clone): Likewise.
	(record_thread): Likewise.
	* location.c (string_to_event_location_basic): Likewise.
	* m32c-tdep.c (m32c_prev_register): Likewise.
	* m32r-linux-tdep.c (m32r_linux_init_abi): Likewise.
	* m32r-tdep.c (decode_prologue): Likewise.
	* m68klinux-tdep.c (m68k_linux_sigtramp_frame_cache): Likewise.
	* machoread.c (macho_symtab_read): Likewise.
	(macho_symfile_read): Likewise.
	(macho_symfile_offsets): Likewise.
	* maint.c (set_per_command_cmd): Likewise.
	* mi/mi-cmd-stack.c (mi_cmd_stack_list_locals): Likewise.
	(mi_cmd_stack_list_variables): Likewise.
	* mi/mi-main.c (mi_cmd_exec_run): Likewise.
	(output_register): Likewise.
	(mi_cmd_execute): Likewise.
	(mi_cmd_trace_define_variable): Likewise.
	(print_variable_or_computed): Likewise.
	* minsyms.c (prim_record_minimal_symbol_full): Likewise.
	* mips-tdep.c (micromips_scan_prologue): Likewise.
	(mips_stub_frame_sniffer): Likewise.
	(mips_o32_push_dummy_call): Likewise.
	(mips_o64_push_dummy_call): Likewise.
	(mips_o64_return_value): Likewise.
	(mips_single_step_through_delay): Likewise.
	(_initialize_mips_tdep): Likewise.
	* mn10300-tdep.c (mn10300_frame_prev_register): Likewise.
	* msp430-tdep.c (msp430_pseudo_register_write): Likewise.
	* mt-tdep.c (mt_registers_info): Likewise.
	* nios2-tdep.c (nios2_analyze_prologue): Likewise.
	(nios2_push_dummy_call): Likewise.
	(nios2_frame_unwind_cache): Likewise.
	(nios2_stub_frame_cache): Likewise.
	(nios2_stub_frame_sniffer): Likewise.
	(nios2_gdbarch_init): Likewise.
	* ppc-ravenscar-thread.c: Likewise.
	* ppcfbsd-tdep.c (ppcfbsd_sigtramp_frame_cache): Likewise.
	* python/py-evts.c (add_new_registry): Likewise.
	* python/py-finishbreakpoint.c (bpfinishpy_init): Likewise.
	(bpfinishpy_detect_out_scope_cb): Likewise.
	* python/py-framefilter.c (py_print_type): Likewise.
	(py_print_value): Likewise.
	* python/py-inferior.c (infpy_write_memory): Likewise.
	* python/py-infevents.c (create_inferior_call_event_object): Likewise.
	* python/py-infthread.c (thpy_get_ptid): Likewise.
	* python/py-linetable.c (ltpy_get_pcs_for_line): Likewise.
	(ltpy_get_all_source_lines): Likewise.
	(ltpy_is_valid): Likewise.
	(ltpy_iternext): Likewise.
	* python/py-symtab.c (symtab_and_line_to_sal_object): Likewise.
	* python/py-unwind.c (pyuw_object_attribute_to_pointer): Likewise.
	(unwind_infopy_str): Likewise.
	* python/py-varobj.c (py_varobj_get_iterator): Likewise.
	* ravenscar-thread.c (ravenscar_inferior_created): Likewise.
	* rs6000-aix-tdep.c (rs6000_push_dummy_call): Likewise.
	* rs6000-lynx178-tdep.c (rs6000_lynx178_push_dummy_call): Likewise.
	* rs6000-tdep.c (ppc_deal_with_atomic_sequence): Likewise.
	* s390-linux-tdep.c (s390_supply_tdb_regset): Likewise.
	(s390_frame_prev_register): Likewise.
	(s390_dwarf2_frame_init_reg): Likewise.
	(s390_record_vr): Likewise.
	(s390_process_record): Likewise.
	* score-tdep.c (score_push_dummy_call): Likewise.
	(score3_analyze_prologue): Likewise.
	* sh-tdep.c (sh_extract_return_value_nofpu): Likewise.
	* sh64-tdep.c (sh64_analyze_prologue): Likewise.
	(sh64_push_dummy_call): Likewise.
	(sh64_extract_return_value): Likewise.
	(sh64_do_fp_register): Likewise.
	* solib-aix.c (solib_aix_get_section_offsets): Likewise.
	* solib-darwin.c (darwin_read_exec_load_addr_from_dyld): Likewise.
	(darwin_solib_read_all_image_info_addr): Likewise.
	* solib-dsbt.c (enable_break): Likewise.
	* solib-frv.c (enable_break2): Likewise.
	(frv_fdpic_find_canonical_descriptor): Likewise.
	* solib-svr4.c (svr4_handle_solib_event): Likewise.
	* sparc-tdep.c (sparc_skip_stack_check): Likewise.
	* sparc64-linux-tdep.c (sparc64_linux_get_longjmp_target): Likewise.
	* sparcobsd-tdep.c (sparc32obsd_init_abi): Likewise.
	* spu-tdep.c (info_spu_dma_cmdlist): Likewise.
	* stack.c (read_frame_local): Likewise.
	* symfile.c (symbol_file_add_separate): Likewise.
	(remove_symbol_file_command): Likewise.
	* symmisc.c (maintenance_print_one_line_table): Likewise.
	* symtab.c (symbol_cache_flush): Likewise.
	(basic_lookup_transparent_type): Likewise.
	(sort_search_symbols_remove_dups): Likewise.
	* target.c (target_memory_map): Likewise.
	(target_detach): Likewise.
	(target_resume): Likewise.
	(acquire_fileio_fd): Likewise.
	(target_store_registers): Likewise.
	* thread.c (print_thread_info_1): Likewise.
	* tic6x-tdep.c (tic6x_analyze_prologue): Likewise.
	* tilegx-linux-tdep.c (tilegx_linux_sigframe_init): Likewise.
	* tilegx-tdep.c (tilegx_push_dummy_call): Likewise.
	(tilegx_analyze_prologue): Likewise.
	(tilegx_stack_frame_destroyed_p): Likewise.
	(tilegx_frame_cache): Likewise.
	* tracefile.c (trace_save): Likewise.
	* tracepoint.c (encode_actions_and_make_cleanup): Likewise.
	(start_tracing): Likewise.
	(print_one_static_tracepoint_marker): Likewise.
	* tui/tui.c (tui_enable): Likewise.
	* valops.c (value_struct_elt_bitpos): Likewise.
	(find_overload_match): Likewise.
	(find_oload_champ): Likewise.
	* value.c (value_contents_copy_raw): Likewise.
	(value_fetch_lazy): Likewise.
	* windows-tdep.c (windows_get_tlb_type): Likewise.
	* x86-linux-nat.c (x86_linux_enable_btrace): Likewise.
	* xcoffread.c (record_minimal_symbol): Likewise.
	(scan_xcoff_symtab): Likewise.
	* xtensa-tdep.c (execute_code): Likewise.
	(xtensa_gdbarch_init): Likewise.
	(_initialize_xtensa_tdep): Likewise.
---
 gdb/aarch64-linux-tdep.c         |  1 -
 gdb/aarch64-tdep.c               | 23 ----------------------
 gdb/alpha-mdebug-tdep.c          |  2 --
 gdb/alpha-tdep.c                 |  1 -
 gdb/amd64-dicos-tdep.c           |  2 --
 gdb/amd64-linux-tdep.c           |  3 ---
 gdb/amd64-tdep.c                 |  3 ---
 gdb/amd64-windows-tdep.c         | 15 ---------------
 gdb/arm-linux-tdep.c             |  2 --
 gdb/arm-symbian-tdep.c           |  2 --
 gdb/arm-tdep.c                   |  6 ------
 gdb/auto-load.c                  |  3 +--
 gdb/avr-tdep.c                   |  3 ---
 gdb/bfin-linux-tdep.c            |  1 -
 gdb/bfin-tdep.c                  | 12 ------------
 gdb/blockframe.c                 |  1 -
 gdb/break-catch-throw.c          |  1 -
 gdb/breakpoint.c                 | 15 ++-------------
 gdb/coffread.c                   |  2 --
 gdb/cris-tdep.c                  | 14 --------------
 gdb/d-exp.y                      |  1 -
 gdb/dbxread.c                    | 20 --------------------
 gdb/dicos-tdep.c                 |  2 --
 gdb/disasm.c                     |  6 ------
 gdb/dtrace-probe.c               |  2 --
 gdb/dwarf2read.c                 | 41 +++-------------------------------------
 gdb/extension.c                  |  2 --
 gdb/frv-linux-tdep.c             |  1 -
 gdb/ft32-tdep.c                  |  3 +--
 gdb/gdbtypes.c                   |  3 ---
 gdb/h8300-tdep.c                 |  7 -------
 gdb/hppa-tdep.c                  |  7 -------
 gdb/hppanbsd-tdep.c              |  2 --
 gdb/hppaobsd-tdep.c              |  1 -
 gdb/i386-dicos-tdep.c            |  2 --
 gdb/i386-tdep.c                  |  5 +----
 gdb/i386nbsd-tdep.c              |  1 -
 gdb/i386obsd-tdep.c              |  2 --
 gdb/ia64-tdep.c                  |  8 ++------
 gdb/infcmd.c                     |  3 ---
 gdb/infrun.c                     |  8 --------
 gdb/iq2000-tdep.c                |  4 ----
 gdb/language.c                   |  3 ---
 gdb/linespec.c                   |  2 --
 gdb/linux-nat.c                  |  4 ----
 gdb/linux-tdep.c                 |  1 -
 gdb/linux-thread-db.c            |  5 -----
 gdb/location.c                   |  2 +-
 gdb/m32c-tdep.c                  |  1 -
 gdb/m32r-linux-tdep.c            |  1 -
 gdb/m32r-tdep.c                  |  2 --
 gdb/m68klinux-tdep.c             |  1 -
 gdb/machoread.c                  |  8 --------
 gdb/maint.c                      |  1 -
 gdb/mi/mi-cmd-stack.c            |  3 ---
 gdb/mi/mi-main.c                 |  5 -----
 gdb/minsyms.c                    |  1 -
 gdb/mips-tdep.c                  | 25 ------------------------
 gdb/mn10300-tdep.c               |  2 --
 gdb/msp430-tdep.c                |  1 -
 gdb/mt-tdep.c                    |  3 +--
 gdb/nios2-tdep.c                 |  9 +--------
 gdb/ppc-ravenscar-thread.c       |  1 -
 gdb/ppcfbsd-tdep.c               |  1 -
 gdb/python/py-evts.c             |  2 --
 gdb/python/py-finishbreakpoint.c |  2 --
 gdb/python/py-framefilter.c      |  7 -------
 gdb/python/py-inferior.c         |  2 --
 gdb/python/py-infevents.c        |  2 --
 gdb/python/py-infthread.c        |  2 --
 gdb/python/py-linetable.c        |  4 ----
 gdb/python/py-symtab.c           |  1 -
 gdb/python/py-unwind.c           |  3 ---
 gdb/python/py-varobj.c           |  1 -
 gdb/ravenscar-thread.c           |  1 -
 gdb/rs6000-aix-tdep.c            |  2 --
 gdb/rs6000-lynx178-tdep.c        |  2 --
 gdb/rs6000-tdep.c                |  1 -
 gdb/s390-linux-tdep.c            |  6 ------
 gdb/score-tdep.c                 |  9 +--------
 gdb/sh-tdep.c                    |  2 --
 gdb/sh64-tdep.c                  |  9 ---------
 gdb/solib-aix.c                  |  1 -
 gdb/solib-darwin.c               |  2 --
 gdb/solib-dsbt.c                 |  2 --
 gdb/solib-frv.c                  |  3 ---
 gdb/solib-svr4.c                 |  1 -
 gdb/sparc-tdep.c                 |  1 -
 gdb/sparc64-linux-tdep.c         |  1 -
 gdb/sparcobsd-tdep.c             |  2 --
 gdb/spu-tdep.c                   |  3 +--
 gdb/stack.c                      |  2 --
 gdb/symfile.c                    |  4 +---
 gdb/symmisc.c                    |  1 -
 gdb/symtab.c                     |  7 +------
 gdb/target.c                     | 10 +---------
 gdb/thread.c                     |  4 ----
 gdb/tic6x-tdep.c                 |  3 ---
 gdb/tilegx-linux-tdep.c          |  1 -
 gdb/tilegx-tdep.c                |  7 +------
 gdb/tracefile.c                  |  6 ------
 gdb/tracepoint.c                 |  6 ------
 gdb/tui/tui.c                    |  2 --
 gdb/valops.c                     |  5 -----
 gdb/value.c                      |  2 --
 gdb/windows-tdep.c               |  5 +----
 gdb/x86-linux-nat.c              |  1 -
 gdb/xcoffread.c                  |  2 --
 gdb/xtensa-tdep.c                |  4 ----
 109 files changed, 20 insertions(+), 451 deletions(-)

diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 651a0f0..cd220a6 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -143,7 +143,6 @@ aarch64_linux_sigframe_init (const struct tramp_frame *self,
 			     struct trad_frame_cache *this_cache,
 			     CORE_ADDR func)
 {
-  struct gdbarch *gdbarch = get_frame_arch (this_frame);
   CORE_ADDR sp = get_frame_register_unsigned (this_frame, AARCH64_SP_REGNUM);
   CORE_ADDR sigcontext_addr =
     sp
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 6f2e38e..88fcf4b 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -415,10 +415,7 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch,
 static CORE_ADDR
 aarch64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
-  unsigned long inst;
-  CORE_ADDR skip_pc;
   CORE_ADDR func_addr, limit_pc;
-  struct symtab_and_line sal;
 
   /* See if we can determine the end of the prologue via the symbol
      table.  If so, then return either PC, or the PC after the
@@ -488,9 +485,6 @@ aarch64_scan_prologue (struct frame_info *this_frame,
   else
     {
       CORE_ADDR frame_loc;
-      LONGEST saved_fp;
-      LONGEST saved_lr;
-      enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
       frame_loc = get_frame_register_unsigned (this_frame, AARCH64_FP_REGNUM);
       if (frame_loc == 0)
@@ -612,7 +606,6 @@ static struct value *
 aarch64_prologue_prev_register (struct frame_info *this_frame,
 				void **this_cache, int prev_regnum)
 {
-  struct gdbarch *gdbarch = get_frame_arch (this_frame);
   struct aarch64_prologue_cache *cache
     = aarch64_make_prologue_cache (this_frame, this_cache);
 
@@ -816,7 +809,6 @@ static struct value *
 aarch64_dwarf2_prev_register (struct frame_info *this_frame,
 			      void **this_cache, int regnum)
 {
-  struct gdbarch *gdbarch = get_frame_arch (this_frame);
   CORE_ADDR lr;
 
   switch (regnum)
@@ -1061,7 +1053,6 @@ pass_in_v (struct gdbarch *gdbarch,
 {
   if (info->nsrn < 8)
     {
-      enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
       int regnum = AARCH64_V0_REGNUM + info->nsrn;
       gdb_byte reg[V_REGISTER_SIZE];
 
@@ -1181,10 +1172,7 @@ aarch64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 			 struct value **args, CORE_ADDR sp, int struct_return,
 			 CORE_ADDR struct_addr)
 {
-  int nstack = 0;
   int argnum;
-  int x_argreg;
-  int v_argreg;
   struct aarch64_call_info info;
   struct type *func_type;
   struct type *return_type;
@@ -1584,8 +1572,6 @@ static const gdb_byte *
 aarch64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
 			    int *lenptr)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
   *lenptr = sizeof (aarch64_default_breakpoint);
   return aarch64_default_breakpoint;
 }
@@ -1709,9 +1695,6 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
 static int
 aarch64_return_in_memory (struct gdbarch *gdbarch, struct type *type)
 {
-  int nRc;
-  enum type_code code;
-
   type = check_typedef (type);
 
   if (is_hfa_or_hva (type))
@@ -1843,7 +1826,6 @@ aarch64_return_value (struct gdbarch *gdbarch, struct value *func_value,
 		      struct type *valtype, struct regcache *regcache,
 		      gdb_byte *readbuf, const gdb_byte *writebuf)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   if (TYPE_CODE (valtype) == TYPE_CODE_STRUCT
       || TYPE_CODE (valtype) == TYPE_CODE_UNION
@@ -2374,7 +2356,6 @@ aarch64_displaced_step_b_cond (const unsigned cond, const int32_t offset,
 {
   struct aarch64_displaced_step_data *dsd
     = (struct aarch64_displaced_step_data *) data;
-  int32_t new_offset = data->insn_addr - dsd->new_addr + offset;
 
   /* GDB has to fix up PC after displaced step this instruction
      differently according to the condition is true or false.  Instead
@@ -2413,7 +2394,6 @@ aarch64_displaced_step_cb (const int32_t offset, const int is_cbnz,
 {
   struct aarch64_displaced_step_data *dsd
     = (struct aarch64_displaced_step_data *) data;
-  int32_t new_offset = data->insn_addr - dsd->new_addr + offset;
 
   /* The offset is out of range for a compare and branch
      instruction.  We can use the following instructions instead:
@@ -2438,7 +2418,6 @@ aarch64_displaced_step_tb (const int32_t offset, int is_tbnz,
 {
   struct aarch64_displaced_step_data *dsd
     = (struct aarch64_displaced_step_data *) data;
-  int32_t new_offset = data->insn_addr - dsd->new_addr + offset;
 
   /* The offset is out of range for a test bit and branch
      instruction We can use the following instructions instead:
@@ -2662,7 +2641,6 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   struct tdesc_arch_data *tdesc_data = NULL;
   const struct target_desc *tdesc = info.target_desc;
   int i;
-  int have_fpa_registers = 1;
   int valid_p = 1;
   const struct tdesc_feature *feature;
   int num_regs = 0;
@@ -3762,7 +3740,6 @@ aarch64_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
   uint32_t rec_no = 0;
   uint8_t insn_size = 4;
   uint32_t ret = 0;
-  ULONGEST t_bit = 0, insn_id = 0;
   gdb_byte buf[insn_size];
   insn_decode_record aarch64_record;
 
diff --git a/gdb/alpha-mdebug-tdep.c b/gdb/alpha-mdebug-tdep.c
index e850aa7..6db84f9 100644
--- a/gdb/alpha-mdebug-tdep.c
+++ b/gdb/alpha-mdebug-tdep.c
@@ -402,8 +402,6 @@ alpha_mdebug_frame_base_sniffer (struct frame_info *this_frame)
 void
 alpha_mdebug_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
   frame_unwind_append_unwinder (gdbarch, &alpha_mdebug_frame_unwind);
   frame_base_append_sniffer (gdbarch, alpha_mdebug_frame_base_sniffer);
 }
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 0206214..b89ea13 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -1857,7 +1857,6 @@ extern initialize_file_ftype _initialize_alpha_tdep; /* -Wmissing-prototypes */
 void
 _initialize_alpha_tdep (void)
 {
-  struct cmd_list_element *c;
 
   gdbarch_register (bfd_arch_alpha, alpha_gdbarch_init, NULL);
 
diff --git a/gdb/amd64-dicos-tdep.c b/gdb/amd64-dicos-tdep.c
index 77cfb1e..e2749a5 100644
--- a/gdb/amd64-dicos-tdep.c
+++ b/gdb/amd64-dicos-tdep.c
@@ -25,8 +25,6 @@
 static void
 amd64_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
   amd64_init_abi (info, gdbarch);
 
   dicos_init_abi (gdbarch);
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 98224c3..3f2a92b 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1733,8 +1733,6 @@ amd64_dtrace_parse_probe_argument (struct gdbarch *gdbarch,
 				   struct parser_state *pstate,
 				   int narg)
 {
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-  struct frame_info *this_frame = get_selected_frame (NULL);
   struct stoken str;
 
   /* DTrace probe arguments can be found on the ABI-defined places for
@@ -1764,7 +1762,6 @@ amd64_dtrace_parse_probe_argument (struct gdbarch *gdbarch,
   else
     {
       /* Additional arguments are passed on the stack.  */
-      CORE_ADDR sp;
       const char *regname = user_reg_map_regnum_to_name (gdbarch, AMD64_RSP_REGNUM);
 
       /* Displacement.  */
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 0065523..6289d21 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -1302,12 +1302,10 @@ static void
 fixup_riprel (struct gdbarch *gdbarch, struct displaced_step_closure *dsc,
 	      CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
 {
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   const struct amd64_insn *insn_details = &dsc->insn_details;
   int modrm_offset = insn_details->modrm_offset;
   gdb_byte *insn = insn_details->raw_insn + modrm_offset;
   CORE_ADDR rip_base;
-  int32_t disp;
   int insn_length;
   int arch_tmp_regno, tmp_regno;
   ULONGEST orig_value;
@@ -1316,7 +1314,6 @@ fixup_riprel (struct gdbarch *gdbarch, struct displaced_step_closure *dsc,
   ++insn;
 
   /* Compute the rip-relative address.	*/
-  disp = extract_signed_integer (insn, sizeof (int32_t), byte_order);
   insn_length = gdb_buffered_insn_length (gdbarch, dsc->insn_buf,
 					  dsc->max_len, from);
   rip_base = from + insn_length;
diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c
index e05502e..1bec6de 100644
--- a/gdb/amd64-windows-tdep.c
+++ b/gdb/amd64-windows-tdep.c
@@ -595,8 +595,6 @@ amd64_windows_frame_decode_epilogue (struct frame_info *this_frame,
 	{
 	  /* rex jmp reg  */
 	  gdb_byte op1;
-	  unsigned int reg;
-	  gdb_byte buf[8];
 
 	  if (target_read_memory (pc + 2, &op1, 1) != 0)
 	    return -1;
@@ -648,7 +646,6 @@ amd64_windows_frame_decode_insns (struct frame_info *this_frame,
 	 address is odd (http://www.codemachine.com/article_x64deepdive.html).
       */
       struct external_pex64_runtime_function d;
-      CORE_ADDR sa, ea;
 
       if (target_read_memory (cache->image_base + (unwind_info & ~1),
 			      (gdb_byte *) &d, sizeof (d)) != 0)
@@ -671,7 +668,6 @@ amd64_windows_frame_decode_insns (struct frame_info *this_frame,
       gdb_byte *end_insns;
       unsigned char codes_count;
       unsigned char frame_reg;
-      unsigned char frame_off;
       CORE_ADDR start;
 
       /* Read and decode header.  */
@@ -1016,13 +1012,7 @@ amd64_windows_frame_cache (struct frame_info *this_frame, void **this_cache)
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   struct amd64_windows_frame_cache *cache;
   gdb_byte buf[8];
-  struct obj_section *sec;
-  pe_data_type *pe;
-  IMAGE_DATA_DIRECTORY *dir;
-  CORE_ADDR image_base;
   CORE_ADDR pc;
-  struct objfile *objfile;
-  unsigned long lo, hi;
   CORE_ADDR unwind_info = 0;
 
   if (*this_cache)
@@ -1065,10 +1055,8 @@ amd64_windows_frame_prev_register (struct frame_info *this_frame,
 				   void **this_cache, int regnum)
 {
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   struct amd64_windows_frame_cache *cache =
     amd64_windows_frame_cache (this_frame, this_cache);
-  struct value *val;
   CORE_ADDR prev;
 
   if (frame_debug)
@@ -1114,7 +1102,6 @@ static void
 amd64_windows_frame_this_id (struct frame_info *this_frame, void **this_cache,
 		   struct frame_id *this_id)
 {
-  struct gdbarch *gdbarch = get_frame_arch (this_frame);
   struct amd64_windows_frame_cache *cache =
     amd64_windows_frame_cache (this_frame, this_cache);
 
@@ -1222,8 +1209,6 @@ amd64_windows_auto_wide_charset (void)
 static void
 amd64_windows_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
   /* The dwarf2 unwinder (appended very early by i386_gdbarch_init) is
      preferred over the SEH one.  The reasons are:
      - binaries without SEH but with dwarf2 debug info are correcly handled
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 9b68315..55bbae7 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -827,7 +827,6 @@ arm_linux_get_syscall_number (struct gdbarch *gdbarch,
 			      ptid_t ptid)
 {
   struct regcache *regs = get_thread_regcache (ptid);
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   ULONGEST pc;
   ULONGEST cpsr;
@@ -877,7 +876,6 @@ arm_linux_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self)
   CORE_ADDR pc = regcache_read_pc (self->regcache);
   int is_thumb = arm_is_thumb (self->regcache);
   ULONGEST svc_number = 0;
-  struct gdbarch *gdbarch = get_regcache_arch (self->regcache);
 
   if (is_thumb)
     {
diff --git a/gdb/arm-symbian-tdep.c b/gdb/arm-symbian-tdep.c
index 18a213c..430b041 100644
--- a/gdb/arm-symbian-tdep.c
+++ b/gdb/arm-symbian-tdep.c
@@ -63,8 +63,6 @@ static void
 arm_symbian_init_abi (struct gdbarch_info info,
 		      struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
   /* Shared library handling.  */
   set_gdbarch_skip_trampoline_code (gdbarch, arm_symbian_skip_trampoline_code);
 
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 0412f71..c7d84be 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -2673,7 +2673,6 @@ static struct arm_prologue_cache *
 arm_make_epilogue_frame_cache (struct frame_info *this_frame)
 {
   struct arm_prologue_cache *cache;
-  CORE_ADDR sp;
   int reg;
 
   cache = FRAME_OBSTACK_ZALLOC (struct arm_prologue_cache);
@@ -2727,11 +2726,8 @@ static struct value *
 arm_epilogue_frame_prev_register (struct frame_info *this_frame,
 				  void **this_cache, int regnum)
 {
-  struct arm_prologue_cache *cache;
-
   if (*this_cache == NULL)
     *this_cache = arm_make_epilogue_frame_cache (this_frame);
-  cache = (struct arm_prologue_cache *) *this_cache;
 
   return arm_prologue_prev_register (this_frame, this_cache, regnum);
 }
@@ -10979,7 +10975,6 @@ arm_record_vdata_transfer_insn (insn_decode_record *arm_insn_r)
   uint32_t bits_a, bit_c, bit_l, reg_t, reg_v;
   uint32_t record_buf[4];
 
-  const int num_regs = gdbarch_num_regs (arm_insn_r->gdbarch);
   reg_t = bits (arm_insn_r->arm_insn, 12, 15);
   reg_v = bits (arm_insn_r->arm_insn, 21, 23);
   bits_a = bits (arm_insn_r->arm_insn, 21, 23);
@@ -11069,7 +11064,6 @@ arm_record_exreg_ld_st_insn (insn_decode_record *arm_insn_r)
   ULONGEST u_regval = 0;
 
   struct regcache *reg_cache = arm_insn_r->regcache;
-  const int num_regs = gdbarch_num_regs (arm_insn_r->gdbarch);
 
   opcode = bits (arm_insn_r->arm_insn, 20, 24);
   single_reg = !bit (arm_insn_r->arm_insn, 8);
diff --git a/gdb/auto-load.c b/gdb/auto-load.c
index fbc39ce..de64112 100644
--- a/gdb/auto-load.c
+++ b/gdb/auto-load.c
@@ -1012,7 +1012,7 @@ execute_script_contents (struct auto_load_pspace_info *pspace_info,
 {
   objfile_script_executor_func *executor;
   const char *newline, *script_text;
-  char *name, *end;
+  char *name;
   int is_safe, in_hash_table;
   struct cleanup *cleanups;
 
@@ -1309,7 +1309,6 @@ char auto_load_info_scripts_pattern_nl[] = "";
 static void
 print_scripts (VEC (loaded_script_ptr) *scripts)
 {
-  struct ui_out *uiout = current_uiout;
   int i;
   loaded_script_ptr script;
 
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 088fe51..f6f43a0 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -1107,8 +1107,6 @@ static struct value *
 avr_frame_prev_register (struct frame_info *this_frame,
 			 void **this_prologue_cache, int regnum)
 {
-  struct gdbarch *gdbarch = get_frame_arch (this_frame);
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   struct avr_unwind_cache *info
     = avr_frame_unwind_cache (this_frame, this_prologue_cache);
 
@@ -1270,7 +1268,6 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                      int nargs, struct value **args, CORE_ADDR sp,
                      int struct_return, CORE_ADDR struct_addr)
 {
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   int i;
   gdb_byte buf[3];
   int call_length = gdbarch_tdep (gdbarch)->call_length;
diff --git a/gdb/bfin-linux-tdep.c b/gdb/bfin-linux-tdep.c
index 1d57ade..94bb609 100644
--- a/gdb/bfin-linux-tdep.c
+++ b/gdb/bfin-linux-tdep.c
@@ -99,7 +99,6 @@ bfin_linux_sigframe_init (const struct tramp_frame *self,
 			  struct trad_frame_cache *this_cache,
 			  CORE_ADDR func)
 {
-  struct gdbarch *gdbarch = get_frame_arch (this_frame);
   CORE_ADDR sp = get_frame_sp (this_frame);
   CORE_ADDR pc = get_frame_pc (this_frame);
   CORE_ADDR sigcontext = sp + SIGCONTEXT_OFFSET;
diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c
index 48a7111..e5b7232 100644
--- a/gdb/bfin-tdep.c
+++ b/gdb/bfin-tdep.c
@@ -500,13 +500,9 @@ bfin_push_dummy_call (struct gdbarch *gdbarch,
 		      CORE_ADDR struct_addr)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-  gdb_byte buf[4];
   int i;
   long reg_r0, reg_r1, reg_r2;
   int total_len = 0;
-  enum bfin_abi abi = bfin_abi (gdbarch);
-  CORE_ADDR func_addr = find_function_addr (function, NULL);
 
   for (i = nargs - 1; i >= 0; i--)
     {
@@ -527,7 +523,6 @@ bfin_push_dummy_call (struct gdbarch *gdbarch,
   for (i = nargs - 1; i >= 0; i--)
     {
       struct type *value_type = value_enclosing_type (args[i]);
-      struct type *arg_type = check_typedef (value_type);
       int container_len = (TYPE_LENGTH (value_type) + 3) & ~3;
 
       sp -= container_len;
@@ -794,15 +789,8 @@ bfin_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
   struct gdbarch_tdep *tdep;
   struct gdbarch *gdbarch;
-  int elf_flags;
   enum bfin_abi abi;
 
-  /* Extract the ELF flags, if available.  */
-  if (info.abfd && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
-    elf_flags = elf_elfheader (info.abfd)->e_flags;
-  else
-    elf_flags = 0;
-
   abi = BFIN_ABI_FLAT;
 
   /* If there is already a candidate, use it.  */
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index b7ae1d9..868db84 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -197,7 +197,6 @@ find_pc_partial_function_gnu_ifunc (CORE_ADDR pc, const char **name,
   struct bound_minimal_symbol msymbol;
   struct compunit_symtab *compunit_symtab = NULL;
   struct objfile *objfile;
-  int i;
   CORE_ADDR mapped_pc;
 
   /* To ensure that the symbol returned belongs to the correct setion
diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c
index 1fbdcc5..153db71 100644
--- a/gdb/break-catch-throw.c
+++ b/gdb/break-catch-throw.c
@@ -107,7 +107,6 @@ fetch_probe_arguments (struct value **arg0, struct value **arg1)
   struct frame_info *frame = get_selected_frame (_("No frame selected"));
   CORE_ADDR pc = get_frame_pc (frame);
   struct bound_probe pc_probe;
-  const struct sym_probe_fns *pc_probe_fns;
   unsigned n_args;
 
   pc_probe = find_probe_by_pc (pc);
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index a39a15c..d2dafef 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1604,7 +1604,6 @@ breakpoint_xfer_memory (gdb_byte *readbuf, gdb_byte *writebuf,
   /* Left boundary, right boundary and median element of our binary
      search.  */
   unsigned bc_l, bc_r, bc;
-  size_t i;
 
   /* Find BC_L which is a leftmost element which may affect BUF
      content.  It is safe to report lower value but a failure to
@@ -1659,9 +1658,6 @@ breakpoint_xfer_memory (gdb_byte *readbuf, gdb_byte *writebuf,
   for (bc = bc_l; bc < bp_location_count; bc++)
   {
     struct bp_location *bl = bp_location[bc];
-    CORE_ADDR bp_addr = 0;
-    int bp_size = 0;
-    int bptoffset = 0;
 
     /* bp_location array has BL->OWNER always non-NULL.  */
     if (bl->owner->type == bp_none)
@@ -4142,7 +4138,7 @@ void
 breakpoint_init_inferior (enum inf_context context)
 {
   struct breakpoint *b, *b_tmp;
-  struct bp_location *bl, **blp_tmp;
+  struct bp_location *bl;
   int ix;
   struct program_space *pspace = current_program_space;
 
@@ -4352,7 +4348,6 @@ int
 breakpoint_inserted_here_p (struct address_space *aspace, CORE_ADDR pc)
 {
   struct bp_location **blp, **blp_tmp = NULL;
-  struct bp_location *bl;
 
   ALL_BP_LOCATIONS_AT_ADDR (blp, blp_tmp, pc)
     {
@@ -4376,7 +4371,6 @@ software_breakpoint_inserted_here_p (struct address_space *aspace,
 				     CORE_ADDR pc)
 {
   struct bp_location **blp, **blp_tmp = NULL;
-  struct bp_location *bl;
 
   ALL_BP_LOCATIONS_AT_ADDR (blp, blp_tmp, pc)
     {
@@ -4399,7 +4393,6 @@ hardware_breakpoint_inserted_here_p (struct address_space *aspace,
 				     CORE_ADDR pc)
 {
   struct bp_location **blp, **blp_tmp = NULL;
-  struct bp_location *bl;
 
   ALL_BP_LOCATIONS_AT_ADDR (blp, blp_tmp, pc)
     {
@@ -5819,7 +5812,6 @@ struct bpstat_what
 bpstat_what (bpstat bs_head)
 {
   struct bpstat_what retval;
-  int jit_event = 0;
   bpstat bs;
 
   retval.main_action = BPSTAT_WHAT_KEEP_CHECKING;
@@ -5941,7 +5933,6 @@ bpstat_what (bpstat bs_head)
 	    }
 	  break;
 	case bp_jit_event:
-	  jit_event = 1;
 	  this_action = BPSTAT_WHAT_SINGLE;
 	  break;
 	case bp_call_dummy:
@@ -10397,7 +10388,7 @@ find_breakpoint_range_end (struct symtab_and_line sal)
 static void
 break_range_command (char *arg, int from_tty)
 {
-  char *arg_start, *addr_string_start, *addr_string_end;
+  char *arg_start, *addr_string_start;
   struct linespec_result canonical_start, canonical_end;
   int bp_count, can_use_bp, length;
   CORE_ADDR end;
@@ -15741,8 +15732,6 @@ save_breakpoints (char *filename, int from_tty,
 
     if (tp->type != bp_dprintf && tp->commands)
       {
-	struct gdb_exception exception;
-
 	fprintf_unfiltered (fp, "  commands\n");
 	
 	ui_out_redirect (current_uiout, fp);
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 0ab526c..830deb5 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -561,7 +561,6 @@ static void
 coff_symfile_read (struct objfile *objfile, int symfile_flags)
 {
   struct coff_symfile_info *info;
-  struct dbx_symfile_info *dbxinfo;
   bfd *abfd = objfile->obfd;
   coff_data_type *cdata = coff_data (abfd);
   char *name = bfd_get_filename (abfd);
@@ -574,7 +573,6 @@ coff_symfile_read (struct objfile *objfile, int symfile_flags)
   
   info = (struct coff_symfile_info *) objfile_data (objfile,
 						    coff_objfile_data_key);
-  dbxinfo = DBX_SYMFILE_INFO (objfile);
   symfile_bfd = abfd;		/* Kludge for swap routines.  */
 
 /* WARNING WILL ROBINSON!  ACCESSING BFD-PRIVATE DATA HERE!  FIXME!  */
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index d350ce8..1d29524 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -811,16 +811,9 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		      int struct_return, CORE_ADDR struct_addr)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-  int stack_offset;
   int argreg;
   int argnum;
 
-  /* The function's arguments and memory allocated by gdb for the arguments to
-     point at reside in separate areas on the stack.
-     Both frame pointers grow toward higher addresses.  */
-  CORE_ADDR fp_arg;
-  CORE_ADDR fp_mem;
-
   struct stack_item *si = NULL;
 
   /* Push the return address.  */
@@ -837,7 +830,6 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   /* Now load as many as possible of the first arguments into registers,
      and push the rest onto the stack.  */
   argreg = ARG1_REGNUM;
-  stack_offset = 0;
 
   for (argnum = 0; argnum < nargs; argnum++)
     {
@@ -1041,9 +1033,6 @@ cris_scan_prologue (CORE_ADDR pc, struct frame_info *this_frame,
   unsigned short insn_next; 
   int regno;
 
-  /* Is there a push fp?  */
-  int have_fp; 
-
   /* Number of byte on stack used for local variables and movem.  */
   int val; 
 
@@ -1472,7 +1461,6 @@ cris_spec_reg_applicable (struct gdbarch *gdbarch,
 static int
 cris_register_size (struct gdbarch *gdbarch, int regno)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   int i;
   int spec_regno;
   
@@ -3894,8 +3882,6 @@ extern initialize_file_ftype _initialize_cris_tdep; /* -Wmissing-prototypes */
 void
 _initialize_cris_tdep (void)
 {
-  struct cmd_list_element *c;
-
   gdbarch_register (bfd_arch_cris, cris_gdbarch_init, cris_dump_tdep);
   
   /* CRIS-specific user-commands.  */
diff --git a/gdb/d-exp.y b/gdb/d-exp.y
index e7b11e7..426f9b3 100644
--- a/gdb/d-exp.y
+++ b/gdb/d-exp.y
@@ -684,7 +684,6 @@ parse_number (struct parser_state *ps, const char *p,
 
   if (parsed_float)
     {
-      const struct builtin_d_type *builtin_d_types;
       const char *suffix;
       int suffix_len;
       char *s, *sp;
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 5ee7315..d5a9587 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -2403,8 +2403,6 @@ dbx_psymtab_to_symtab_1 (struct objfile *objfile, struct partial_symtab *pst)
 static void
 dbx_read_symtab (struct partial_symtab *self, struct objfile *objfile)
 {
-  bfd *sym_bfd;
-
   if (self->readin)
     {
       fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in.  "
@@ -2425,8 +2423,6 @@ dbx_read_symtab (struct partial_symtab *self, struct objfile *objfile)
 	  gdb_flush (gdb_stdout);
 	}
 
-      sym_bfd = objfile->obfd;
-
       next_symbol_text_func = dbx_next_symbol_text;
 
       back_to = make_cleanup (null_cleanup, NULL);
@@ -2695,10 +2691,6 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
      source file.  Used to detect the SunPRO solaris compiler.  */
   static int n_opt_found;
 
-  /* The stab type used for the definition of the last function.
-     N_STSYM or N_GSYM for SunOS4 acc; N_FUN for other compilers.  */
-  static int function_stab_type = 0;
-
   if (!block_address_function_relative)
     {
       /* N_LBRAC, N_RBRAC and N_SLINE entries are not relative to the
@@ -3103,8 +3095,6 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
 	    {
 	    case 'f':
 	    case 'F':
-	      function_stab_type = type;
-
 	      /* Deal with the SunPRO 3.0 compiler which omits the
 	         address from N_FUN symbols.  */
 	      if (type == N_FUN
@@ -3273,13 +3263,8 @@ coffstab_build_psymtabs (struct objfile *objfile,
   int val;
   bfd *sym_bfd = objfile->obfd;
   char *name = bfd_get_filename (sym_bfd);
-  struct dbx_symfile_info *info;
   unsigned int stabsize;
 
-  /* There is already a dbx_symfile_info allocated by our caller.
-     It might even contain some info from the coff symtab to help us.  */
-  info = DBX_SYMFILE_INFO (objfile);
-
   DBX_TEXT_ADDR (objfile) = textaddr;
   DBX_TEXT_SIZE (objfile) = textsize;
 
@@ -3362,13 +3347,8 @@ elfstab_build_psymtabs (struct objfile *objfile, asection *stabsect,
   int val;
   bfd *sym_bfd = objfile->obfd;
   char *name = bfd_get_filename (sym_bfd);
-  struct dbx_symfile_info *info;
   struct cleanup *back_to = make_cleanup (null_cleanup, NULL);
 
-  /* There is already a dbx_symfile_info allocated by our caller.
-     It might even contain some info from the ELF symtab to help us.  */
-  info = DBX_SYMFILE_INFO (objfile);
-
   /* Find the first and last text address.  dbx_symfile_read seems to
      want this.  */
   find_text_range (sym_bfd, objfile);
diff --git a/gdb/dicos-tdep.c b/gdb/dicos-tdep.c
index 2cb244a..d52e77a 100644
--- a/gdb/dicos-tdep.c
+++ b/gdb/dicos-tdep.c
@@ -27,8 +27,6 @@
 void
 dicos_init_abi (struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
   set_solib_ops (gdbarch, &solib_target_so_ops);
 
   /* Every process, although has its own address space, sees the same
diff --git a/gdb/disasm.c b/gdb/disasm.c
index 1cf0901..f611721 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -493,12 +493,8 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch, struct ui_out *uiout,
 			      CORE_ADDR low, CORE_ADDR high,
 			      int how_many, int flags, struct ui_file *stb)
 {
-  int newlines = 0;
   const struct linetable_entry *le, *first_le;
-  struct symtab_and_line sal;
   int i, nlines;
-  int out_of_order = 0;
-  int next_line = 0;
   int num_displayed = 0;
   print_source_lines_flags psl_flags = 0;
   struct cleanup *cleanups;
@@ -592,7 +588,6 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch, struct ui_out *uiout,
 
   while (pc < high)
     {
-      struct linetable_entry *le = NULL;
       struct symtab_and_line sal;
       CORE_ADDR end_pc;
       int start_preceding_line_to_display = 0;
@@ -804,7 +799,6 @@ gdb_disassembly (struct gdbarch *gdbarch, struct ui_out *uiout,
   struct cleanup *cleanups = make_cleanup_ui_file_delete (stb);
   struct disassemble_info di = gdb_disassemble_info (gdbarch, stb);
   struct symtab *symtab;
-  struct linetable_entry *le = NULL;
   int nlines = -1;
 
   /* Assume symtab is valid for whole PC range.  */
diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c
index 4ce8896..242e316 100644
--- a/gdb/dtrace-probe.c
+++ b/gdb/dtrace-probe.c
@@ -463,8 +463,6 @@ static void
 dtrace_process_dof (asection *sect, struct objfile *objfile,
 		    VEC (probe_p) **probesp, struct dtrace_dof_hdr *dof)
 {
-  bfd *abfd = objfile->obfd;
-  int size = bfd_get_arch_size (abfd) / 8;
   struct gdbarch *gdbarch = get_objfile_arch (objfile);
   struct dtrace_dof_sect *section;
   int i;
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 7bbf080..dad4c9d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -4381,7 +4381,6 @@ error_check_comp_unit_head (struct comp_unit_head *header,
 			    struct dwarf2_section_info *section,
 			    struct dwarf2_section_info *abbrev_section)
 {
-  bfd *abfd = get_section_bfd_owner (section);
   const char *filename = get_section_file_name (section);
 
   if (header->version != 2 && header->version != 3 && header->version != 4)
@@ -6181,13 +6180,11 @@ sort_tu_by_abbrev_offset (const void *ap, const void *bp)
 static void
 build_type_psymtabs_1 (void)
 {
-  struct objfile *objfile = dwarf2_per_objfile->objfile;
   struct tu_stats *tu_stats = &dwarf2_per_objfile->tu_stats;
   struct cleanup *cleanups;
   struct abbrev_table *abbrev_table;
   sect_offset abbrev_offset;
   struct tu_abbrev_offset *sorted_by_abbrev;
-  struct type_unit_group **iter;
   int i;
 
   /* It's up to the caller to not call us multiple times.  */
@@ -7258,7 +7255,6 @@ skip_one_die (const struct die_reader_specs *reader, const gdb_byte *info_ptr,
   struct dwarf2_cu *cu = reader->cu;
   const gdb_byte *buffer = reader->buffer;
   const gdb_byte *buffer_end = reader->buffer_end;
-  const gdb_byte *start_info_ptr = info_ptr;
   unsigned int form, i;
 
   for (i = 0; i < abbrev->num_attrs; i++)
@@ -8212,7 +8208,6 @@ process_imported_unit_die (struct die_info *die, struct dwarf2_cu *cu)
   if (attr != NULL)
     {
       struct dwarf2_per_cu_data *per_cu;
-      struct symtab *imported_symtab;
       sect_offset offset;
       int is_dwz;
 
@@ -8703,7 +8698,6 @@ static const char *
 dwarf2_physname (const char *name, struct die_info *die, struct dwarf2_cu *cu)
 {
   struct objfile *objfile = cu->objfile;
-  struct attribute *attr;
   const char *retval, *mangled = NULL, *canon = NULL;
   struct cleanup *back_to;
   int need_copy = 1;
@@ -9198,7 +9192,6 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
   const char *name = NULL;
   const char *comp_dir = NULL;
   struct die_info *child_die;
-  bfd *abfd = objfile->obfd;
   CORE_ADDR baseaddr;
 
   baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
@@ -9279,7 +9272,6 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
 static void
 setup_type_unit_groups (struct die_info *die, struct dwarf2_cu *cu)
 {
-  struct objfile *objfile = dwarf2_per_objfile->objfile;
   struct dwarf2_per_cu_data *per_cu = cu->per_cu;
   struct type_unit_group *tu_group;
   int first_time;
@@ -9536,7 +9528,6 @@ create_dwo_cu_reader (const struct die_reader_specs *reader,
 		      void *datap)
 {
   struct dwarf2_cu *cu = reader->cu;
-  struct objfile *objfile = dwarf2_per_objfile->objfile;
   sect_offset offset = cu->per_cu->offset;
   struct dwarf2_section_info *section = cu->per_cu->section;
   struct create_dwo_cu_data *data = (struct create_dwo_cu_data *) datap;
@@ -9573,8 +9564,6 @@ create_dwo_cu (struct dwo_file *dwo_file)
 {
   struct objfile *objfile = dwarf2_per_objfile->objfile;
   struct dwarf2_section_info *section = &dwo_file->sections.info;
-  bfd *abfd;
-  htab_t cu_htab;
   const gdb_byte *info_ptr, *end_ptr;
   struct create_dwo_cu_data create_dwo_cu_data;
   struct dwo_unit *dwo_unit;
@@ -9585,10 +9574,6 @@ create_dwo_cu (struct dwo_file *dwo_file)
   if (info_ptr == NULL)
     return NULL;
 
-  /* We can't set abfd until now because the section may be empty or
-     not present, in which case section->asection will be NULL.  */
-  abfd = get_section_bfd_owner (section);
-
   if (dwarf_read_debug)
     {
       fprintf_unfiltered (gdb_stdlog, "Reading %s for %s:\n",
@@ -10029,7 +10014,6 @@ create_dwo_unit_in_dwp_v1 (struct dwp_file *dwp_file,
   struct virtual_v1_dwo_sections sections;
   void **dwo_file_slot;
   char *virtual_dwo_name;
-  struct dwarf2_section_info *cutu;
   struct cleanup *cleanups;
   int i;
 
@@ -10235,7 +10219,6 @@ create_dwo_unit_in_dwp_v2 (struct dwp_file *dwp_file,
   struct virtual_v2_dwo_sections sections;
   void **dwo_file_slot;
   char *virtual_dwo_name;
-  struct dwarf2_section_info *cutu;
   struct cleanup *cleanups;
   int i;
 
@@ -10405,7 +10388,7 @@ lookup_dwo_unit_in_dwp (struct dwp_file *dwp_file, const char *comp_dir,
   uint32_t hash2 = ((signature >> 32) & mask) | 1;
   unsigned int i;
   void **slot;
-  struct dwo_unit find_dwo_cu, *dwo_cu;
+  struct dwo_unit find_dwo_cu;
 
   memset (&find_dwo_cu, 0, sizeof (find_dwo_cu));
   find_dwo_cu.signature = signature;
@@ -11136,8 +11119,6 @@ queue_and_load_all_dwo_tus (struct dwarf2_per_cu_data *per_cu)
 static void
 free_dwo_file (struct dwo_file *dwo_file, struct objfile *objfile)
 {
-  int ix;
-  struct dwarf2_section_info *section;
 
   /* Note: dbfd is NULL for virtual DWO files.  */
   gdb_bfd_unref (dwo_file->dbfd);
@@ -12340,7 +12321,6 @@ dwarf2_record_block_ranges (struct die_info *die, struct block *block,
 static void
 check_producer (struct dwarf2_cu *cu)
 {
-  const char *cs;
   int major, minor;
 
   if (cu->producer == NULL)
@@ -12640,11 +12620,8 @@ static void
 dwarf2_add_typedef (struct field_info *fip, struct die_info *die,
 		    struct dwarf2_cu *cu)
 {
-  struct objfile *objfile = cu->objfile;
   struct typedef_field_list *new_field;
-  struct attribute *attr;
   struct typedef_field *fp;
-  char *fieldname = "";
 
   /* Allocate a new field list entry and link it in.  */
   new_field = XCNEW (struct typedef_field_list);
@@ -12951,13 +12928,6 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
 		       && DW_BLOCK (attr)->data[0] == DW_OP_deref_size
 		       && DW_BLOCK (attr)->data[1] == cu->header.addr_size))
 	    {
-	      struct dwarf_block blk;
-	      int offset;
-
-	      offset = (DW_BLOCK (attr)->data[0] == DW_OP_deref
-			? 1 : 2);
-	      blk.size = DW_BLOCK (attr)->size - offset;
-	      blk.data = DW_BLOCK (attr)->data + offset;
 	      fnp->voffset = decode_locdesc (DW_BLOCK (attr), cu);
 	      if ((fnp->voffset % cu->header.addr_size) != 0)
 		dwarf2_complex_location_expr_complaint ();
@@ -16768,13 +16738,12 @@ read_unsigned_leb128 (bfd *abfd, const gdb_byte *buf,
 {
   ULONGEST result;
   unsigned int num_read;
-  int i, shift;
+  int shift;
   unsigned char byte;
 
   result = 0;
   shift = 0;
   num_read = 0;
-  i = 0;
   while (1)
     {
       byte = bfd_get_8 (abfd, buf);
@@ -16796,13 +16765,12 @@ read_signed_leb128 (bfd *abfd, const gdb_byte *buf,
 		    unsigned int *bytes_read_ptr)
 {
   LONGEST result;
-  int i, shift, num_read;
+  int shift, num_read;
   unsigned char byte;
 
   result = 0;
   shift = 0;
   num_read = 0;
-  i = 0;
   while (1)
     {
       byte = bfd_get_8 (abfd, buf);
@@ -18857,7 +18825,6 @@ dwarf2_const_value (const struct attribute *attr, struct symbol *sym,
 		    struct dwarf2_cu *cu)
 {
   struct objfile *objfile = cu->objfile;
-  struct comp_unit_head *cu_header = &cu->header;
   LONGEST value;
   const gdb_byte *bytes;
   struct dwarf2_locexpr_baton *baton;
@@ -20320,7 +20287,6 @@ static struct die_info *
 follow_die_sig_1 (struct die_info *src_die, struct signatured_type *sig_type,
 		  struct dwarf2_cu **ref_cu)
 {
-  struct objfile *objfile = (*ref_cu)->objfile;
   struct die_info temp_die;
   struct dwarf2_cu *sig_cu;
   struct die_info *die;
@@ -21503,7 +21469,6 @@ dwarf_decode_macro_bytes (bfd *abfd,
 	    void **slot;
 	    bfd *include_bfd = abfd;
 	    struct dwarf2_section_info *include_section = section;
-	    struct dwarf2_section_info alt_section;
 	    const gdb_byte *include_mac_end = mac_end;
 	    int is_dwz = section_is_dwz;
 	    const gdb_byte *new_mac_ptr;
diff --git a/gdb/extension.c b/gdb/extension.c
index 17268d6..ae24518 100644
--- a/gdb/extension.c
+++ b/gdb/extension.c
@@ -774,8 +774,6 @@ set_active_ext_lang (const struct extension_language_defn *now_active)
 void
 restore_active_ext_lang (struct active_ext_lang_state *previous)
 {
-  const struct extension_language_defn *current = active_ext_lang;
-
   active_ext_lang = previous->ext_lang;
 
   if (target_terminal_is_ours ())
diff --git a/gdb/frv-linux-tdep.c b/gdb/frv-linux-tdep.c
index 99a3648..e647201 100644
--- a/gdb/frv-linux-tdep.c
+++ b/gdb/frv-linux-tdep.c
@@ -261,7 +261,6 @@ frv_linux_sigtramp_frame_cache (struct frame_info *this_frame,
 				void **this_cache)
 {
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   struct trad_frame_cache *cache;
   CORE_ADDR addr;
diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c
index 720eaa7..5eaa682 100644
--- a/gdb/ft32-tdep.c
+++ b/gdb/ft32-tdep.c
@@ -162,8 +162,7 @@ ft32_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR next_addr;
-  ULONGEST inst, inst2;
-  LONGEST offset;
+  ULONGEST inst;
   int regnum, pushreg;
   struct bound_minimal_symbol msymbol;
   const int first_saved_reg = 13;	/* The first saved register.  */
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index c8fd0c1..9e1759b 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1421,7 +1421,6 @@ lookup_typename (const struct language_defn *language,
 		 const struct block *block, int noerr)
 {
   struct symbol *sym;
-  struct type *type;
 
   sym = lookup_symbol_in_language (name, block, VAR_DOMAIN,
 				   language->la_language, NULL).symbol;
@@ -1889,7 +1888,6 @@ resolve_dynamic_range (struct type *dyn_range_type,
   CORE_ADDR value;
   struct type *static_range_type, *static_target_type;
   const struct dynamic_prop *prop;
-  const struct dwarf2_locexpr_baton *baton;
   struct dynamic_prop low_bound, high_bound;
 
   gdb_assert (TYPE_CODE (dyn_range_type) == TYPE_CODE_RANGE);
@@ -2431,7 +2429,6 @@ check_typedef (struct type *type)
 
   if (TYPE_TARGET_STUB (type))
     {
-      struct type *range_type;
       struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type));
 
       if (TYPE_STUB (target_type) || TYPE_TARGET_STUB (target_type))
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 0e80ec8..d479a20 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -236,8 +236,6 @@ h8300_is_argument_spill (struct gdbarch *gdbarch, CORE_ADDR pc)
 	}
       else if (IS_MOVL_EXT (w2))
 	{
-	  int w3 = read_memory_integer (pc + 4, 2, byte_order);
-
 	  if (IS_MOVL_Rn24_SP (read_memory_integer (pc + 4, 2, byte_order)))
 	    {
 	      LONGEST disp = read_memory_integer (pc + 6, 4, byte_order);
@@ -1258,17 +1256,12 @@ h8300_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
 static struct gdbarch *
 h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
-  struct gdbarch_tdep *tdep = NULL;
   struct gdbarch *gdbarch;
 
   arches = gdbarch_list_lookup_by_info (arches, &info);
   if (arches != NULL)
     return arches->gdbarch;
 
-#if 0
-  tdep = XNEW (struct gdbarch_tdep);
-#endif
-
   if (info.bfd_arch_info->arch != bfd_arch_h8300)
     return NULL;
 
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index ac507e7..f879a25 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -730,10 +730,6 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   /* Stack base address at which the first parameter is stored.  */
   CORE_ADDR param_end = 0;
 
-  /* The inner most end of the stack after all the parameters have
-     been pushed.  */
-  CORE_ADDR new_sp = 0;
-
   /* Two passes.  First pass computes the location of everything,
      second pass writes the bytes out.  */
   int write_pass;
@@ -2288,7 +2284,6 @@ hppa_frame_this_id (struct frame_info *this_frame, void **this_cache,
 		    struct frame_id *this_id)
 {
   struct hppa_frame_cache *info;
-  CORE_ADDR pc = get_frame_pc (this_frame);
   struct unwind_table_entry *u;
 
   info = hppa_frame_cache (this_frame, this_cache);
@@ -3224,8 +3219,6 @@ extern initialize_file_ftype _initialize_hppa_tdep;
 void
 _initialize_hppa_tdep (void)
 {
-  struct cmd_list_element *c;
-
   gdbarch_register (bfd_arch_hppa, hppa_gdbarch_init, hppa_dump_tdep);
 
   hppa_objfile_priv_data = register_objfile_data ();
diff --git a/gdb/hppanbsd-tdep.c b/gdb/hppanbsd-tdep.c
index 4fb17cc..33d9ca8 100644
--- a/gdb/hppanbsd-tdep.c
+++ b/gdb/hppanbsd-tdep.c
@@ -101,8 +101,6 @@ hppanbsd_sigtramp_cache_init (const struct tramp_frame *self,
                              struct trad_frame_cache *this_cache,
                              CORE_ADDR func)
 {
-  struct gdbarch *gdbarch = get_frame_arch (this_frame);
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   CORE_ADDR sp = get_frame_register_unsigned (this_frame, HPPA_SP_REGNUM);
   CORE_ADDR base;
   int *reg_offset;
diff --git a/gdb/hppaobsd-tdep.c b/gdb/hppaobsd-tdep.c
index 28f5d2f..ad914e1 100644
--- a/gdb/hppaobsd-tdep.c
+++ b/gdb/hppaobsd-tdep.c
@@ -113,7 +113,6 @@ hppaobsd_supply_fpregset (const struct regset *regset,
 			  struct regcache *regcache,
 			  int regnum, const void *fpregs, size_t len)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
   const gdb_byte *regs = (const gdb_byte *) fpregs;
   int i;
 
diff --git a/gdb/i386-dicos-tdep.c b/gdb/i386-dicos-tdep.c
index 75ab996..e7f2369 100644
--- a/gdb/i386-dicos-tdep.c
+++ b/gdb/i386-dicos-tdep.c
@@ -24,8 +24,6 @@
 static void
 i386_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
   dicos_init_abi (gdbarch);
 }
 
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 83a4881..92987af 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -3019,7 +3019,7 @@ i386_bnd_type (struct gdbarch *gdbarch)
 
   if (!tdep->i386_bnd_type)
     {
-      struct type *t, *bound_t;
+      struct type *t;
       const struct builtin_type *bt = builtin_type (gdbarch);
 
       /* The type we're building is described bellow:  */
@@ -8313,8 +8313,6 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   int ymm0_regnum;
   int bnd0_regnum;
   int num_bnd_cooked;
-  int k0_regnum;
-  int zmm0_regnum;
 
   /* If there is already a candidate, use it.  */
   arches = gdbarch_list_lookup_by_info (arches, &info);
@@ -8694,7 +8692,6 @@ i386_mpx_bd_base (void)
   struct gdbarch_tdep *tdep;
   ULONGEST ret;
   enum register_status regstatus;
-  struct gdb_exception except;
 
   rcache = get_current_regcache ();
   tdep = gdbarch_tdep (get_regcache_arch (rcache));
diff --git a/gdb/i386nbsd-tdep.c b/gdb/i386nbsd-tdep.c
index 9a48c59..f73e5c1 100644
--- a/gdb/i386nbsd-tdep.c
+++ b/gdb/i386nbsd-tdep.c
@@ -229,7 +229,6 @@ i386nbsd_sigtramp_cache_init (const struct tramp_frame *self,
 			      CORE_ADDR func)
 {
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR sp = get_frame_register_unsigned (this_frame, I386_ESP_REGNUM);
   CORE_ADDR base;
diff --git a/gdb/i386obsd-tdep.c b/gdb/i386obsd-tdep.c
index 1bdc5d6..08becfa 100644
--- a/gdb/i386obsd-tdep.c
+++ b/gdb/i386obsd-tdep.c
@@ -489,8 +489,6 @@ i386obsd_aout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 static void
 i386obsd_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
   /* It's still OpenBSD.  */
   i386obsd_init_abi (info, gdbarch);
 
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 63959b7..681c560 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -126,8 +126,6 @@ static CORE_ADDR ia64_find_global_pointer (struct gdbarch *gdbarch,
 #define NUM_IA64_RAW_REGS 462
 
 static int sp_regnum = IA64_GR12_REGNUM;
-static int fp_regnum = IA64_VFP_REGNUM;
-static int lr_regnum = IA64_VRAP_REGNUM;
 
 /* NOTE: we treat the register stack registers r32-r127 as
    pseudo-registers because they may not be accessible via the ptrace
@@ -1399,7 +1397,6 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc,
       && it == M && ((instr & 0x1ee0000003fLL) == 0x02c00000000LL))
     {
       /* alloc - start of a regular function.  */
-      int sor = (int) ((instr & 0x00078000000LL) >> 27);
       int sol = (int) ((instr & 0x00007f00000LL) >> 20);
       int sof = (int) ((instr & 0x000000fe000LL) >> 13);
       int rN = (int) ((instr & 0x00000001fc0LL) >> 6);
@@ -1850,7 +1847,7 @@ ia64_frame_cache (struct frame_info *this_frame, void **this_cache)
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   struct ia64_frame_cache *cache;
   gdb_byte buf[8];
-  CORE_ADDR cfm, psr;
+  CORE_ADDR cfm;
 
   if (*this_cache)
     return (struct ia64_frame_cache *) *this_cache;
@@ -1868,7 +1865,6 @@ ia64_frame_cache (struct frame_info *this_frame, void **this_cache)
   cache->bsp = extract_unsigned_integer (buf, 8, byte_order);
   
   get_frame_register (this_frame, IA64_PSR_REGNUM, buf);
-  psr = extract_unsigned_integer (buf, 8, byte_order);
 
   get_frame_register (this_frame, IA64_CFM_REGNUM, buf);
   cfm = extract_unsigned_integer (buf, 8, byte_order);
@@ -3723,7 +3719,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   int nslots, rseslots, memslots, slotnum, nfuncargs;
   int floatreg;
   ULONGEST bsp;
-  CORE_ADDR funcdescaddr, pc, global_pointer;
+  CORE_ADDR funcdescaddr, global_pointer;
   CORE_ADDR func_addr = find_function_addr (function, NULL);
 
   nslots = 0;
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index a80b4c6..51fef85 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1840,8 +1840,6 @@ finish_command_fsm_return_value (struct thread_fsm *self)
 static enum async_reply_reason
 finish_command_fsm_async_reply_reason (struct thread_fsm *self)
 {
-  struct finish_command_fsm *f = (struct finish_command_fsm *) self;
-
   if (execution_direction == EXEC_REVERSE)
     return EXEC_ASYNC_END_STEPPING_RANGE;
   else
@@ -2276,7 +2274,6 @@ default_print_one_register_info (struct ui_file *file,
   if (TYPE_CODE (regtype) == TYPE_CODE_FLT
       || TYPE_CODE (regtype) == TYPE_CODE_DECFLOAT)
     {
-      int j;
       struct value_print_options opts;
       const gdb_byte *valaddr = value_contents_for_printing (val);
       enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (regtype));
diff --git a/gdb/infrun.c b/gdb/infrun.c
index cfb1d06..63204c2 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -463,8 +463,6 @@ holding the child stopped.  Try \"set detach-on-fork\" or \
       /* Detach new forked process?  */
       if (detach_fork)
 	{
-	  struct cleanup *old_chain;
-
 	  /* Before detaching from the child, remove all breakpoints
 	     from it.  If we forked, then this has already been taken
 	     care of by infrun.c.  If we vforked however, any
@@ -2186,7 +2184,6 @@ start_step_over (void)
 static void
 infrun_thread_ptid_changed (ptid_t old_ptid, ptid_t new_ptid)
 {
-  struct displaced_step_request *it;
   struct displaced_step_inferior_state *displaced;
 
   if (ptid_equal (inferior_ptid, old_ptid))
@@ -2942,7 +2939,6 @@ thread_still_needs_step_over_bp (struct thread_info *tp)
 static step_over_what
 thread_still_needs_step_over (struct thread_info *tp)
 {
-  struct inferior *inf = find_inferior_ptid (tp->ptid);
   step_over_what what = 0;
 
   if (thread_still_needs_step_over_bp (tp))
@@ -4622,7 +4618,6 @@ stop_all_threads (void)
 		{
 		  enum gdb_signal sig;
 		  struct regcache *regcache;
-		  struct address_space *aspace;
 
 		  if (debug_infrun)
 		    {
@@ -5389,7 +5384,6 @@ static void
 restart_threads (struct thread_info *event_thread)
 {
   struct thread_info *tp;
-  struct thread_info *step_over = NULL;
 
   /* In case the instruction just stepped spawned a new thread.  */
   update_thread_list ();
@@ -7154,7 +7148,6 @@ static int
 keep_going_stepped_thread (struct thread_info *tp)
 {
   struct frame_info *frame;
-  struct gdbarch *gdbarch;
   struct execution_control_state ecss;
   struct execution_control_state *ecs = &ecss;
 
@@ -7197,7 +7190,6 @@ keep_going_stepped_thread (struct thread_info *tp)
 
   stop_pc = regcache_read_pc (get_thread_regcache (tp->ptid));
   frame = get_current_frame ();
-  gdbarch = get_frame_arch (frame);
 
   /* If the PC of the thread we were trying to single-step has
      changed, then that thread has trapped or been signaled, but the
diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c
index ff297f2..14d2afe 100644
--- a/gdb/iq2000-tdep.c
+++ b/gdb/iq2000-tdep.c
@@ -206,8 +206,6 @@ iq2000_scan_prologue (struct gdbarch *gdbarch,
   struct symtab_and_line sal;
   CORE_ADDR pc;
   CORE_ADDR loop_end;
-  int found_store_lr = 0;
-  int found_decr_sp = 0;
   int srcreg;
   int tgtreg;
   signed short offset;
@@ -251,7 +249,6 @@ iq2000_scan_prologue (struct gdbarch *gdbarch,
 	    cache->saved_regs[tgtreg] = -((signed short) (insn & 0xffff));
 
 	  if (tgtreg == E_LR_REGNUM)
-	    found_store_lr = 1;
 	  continue;
 	}
 
@@ -259,7 +256,6 @@ iq2000_scan_prologue (struct gdbarch *gdbarch,
 	{
 	  /* addi %1, %1, -N == addi %sp, %sp, -N */
 	  /* LEGACY -- from assembly-only port.  */
-	  found_decr_sp = 1;
 	  cache->framesize = -((signed short) (insn & 0xffff));
 	  continue;
 	}
diff --git a/gdb/language.c b/gdb/language.c
index 78ec422..8469754 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -1074,9 +1074,6 @@ language_init_primitive_type_symbols (struct language_arch_info *lai,
 				      struct gdbarch *gdbarch)
 {
   int n;
-  struct compunit_symtab *cust;
-  struct symtab *symtab;
-  struct block *static_block, *global_block;
 
   gdb_assert (lai->primitive_type_vector != NULL);
 
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 2360cc1..c0c3b3b3 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -845,8 +845,6 @@ add_sal_to_sals (struct linespec_state *self,
       canonical = &self->canonical_names[sals->nelts - 1];
       if (!literal_canonical && sal->symtab)
 	{
-	  const char *fullname = symtab_to_fullname (sal->symtab);
-
 	  /* Note that the filter doesn't have to be a valid linespec
 	     input.  We only apply the ":LINE" treatment to Ada for
 	     the time being.  */
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index b75153c..edde88d 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -2458,7 +2458,6 @@ status_callback (struct lwp_info *lp, void *data)
       || lp->stop_reason == TARGET_STOPPED_BY_HW_BREAKPOINT)
     {
       struct regcache *regcache = get_thread_regcache (lp->ptid);
-      struct gdbarch *gdbarch = get_regcache_arch (regcache);
       CORE_ADDR pc;
       int discard = 0;
 
@@ -3562,7 +3561,6 @@ kill_unfollowed_fork_children (struct inferior *inf)
 	    ptid_t child_ptid = ws->value.related_pid;
 	    int child_pid = ptid_get_pid (child_ptid);
 	    int child_lwp = ptid_get_lwp (child_ptid);
-	    int status;
 
 	    kill_one_lwp (child_lwp);
 	    kill_wait_one_lwp (child_lwp);
@@ -3577,8 +3575,6 @@ kill_unfollowed_fork_children (struct inferior *inf)
 static void
 linux_nat_kill (struct target_ops *ops)
 {
-  struct target_waitstatus last;
-
   /* If we're stopped while forking and we haven't followed yet,
      kill the other task.  We need to do this first because the
      parent will be sleeping if this is a vfork.  */
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index 620181c..b8d063f 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -1757,7 +1757,6 @@ linux_fill_prpsinfo (struct elf_internal_linux_prpsinfo *p)
   int n_fields = 0;
   /* Cleanups.  */
   struct cleanup *c;
-  int i;
 
   gdb_assert (p != NULL);
 
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 992965f..844b05c 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -373,9 +373,6 @@ thread_from_lwp (ptid_t ptid)
 int
 thread_db_notice_clone (ptid_t parent, ptid_t child)
 {
-  td_thrhandle_t th;
-  td_thrinfo_t ti;
-  td_err_e err;
   struct thread_db_info *info;
 
   info = get_thread_db_info (ptid_get_pid (child));
@@ -1061,9 +1058,7 @@ record_thread (struct thread_db_info *info,
 	       ptid_t ptid, const td_thrhandle_t *th_p,
 	       const td_thrinfo_t *ti_p)
 {
-  td_err_e err;
   struct private_thread_info *priv;
-  int new_thread = (tp == NULL);
 
   /* A thread ID of zero may mean the thread library has not
      initialized yet.  Leave private == NULL until the thread library
diff --git a/gdb/location.c b/gdb/location.c
index bbd2696..071d262 100644
--- a/gdb/location.c
+++ b/gdb/location.c
@@ -640,7 +640,7 @@ string_to_event_location_basic (char **stringp,
 				const struct language_defn *language)
 {
   struct event_location *location;
-  const char *arg, *orig, *cs;
+  const char *cs;
 
   /* Try the input as a probe spec.  */
   cs = *stringp;
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index 90bd732..59927a6 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -1949,7 +1949,6 @@ m32c_prev_register (struct frame_info *this_frame,
   struct m32c_prologue *p
     = m32c_analyze_frame_prologue (this_frame, this_prologue_cache);
   CORE_ADDR frame_base = m32c_frame_base (this_frame, this_prologue_cache);
-  int reg_size = register_size (get_frame_arch (this_frame), regnum);
 
   if (regnum == tdep->sp->num)
     return frame_unwind_got_constant (this_frame, regnum, frame_base);
diff --git a/gdb/m32r-linux-tdep.c b/gdb/m32r-linux-tdep.c
index 937a24b..7fbe6a5 100644
--- a/gdb/m32r-linux-tdep.c
+++ b/gdb/m32r-linux-tdep.c
@@ -447,7 +447,6 @@ m32r_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
 static void
 m32r_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   linux_init_abi (info, gdbarch);
 
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index f904fad..bc4b2d2 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -355,9 +355,7 @@ decode_prologue (struct gdbarch *gdbarch,
 
       if ((insn & 0xf0ff) == 0x207f)
 	{			/* st reg, @-sp */
-	  int regno;
 	  framesize += 4;
-	  regno = ((insn >> 8) & 0xf);
 	  after_prologue = 0;
 	  continue;
 	}
diff --git a/gdb/m68klinux-tdep.c b/gdb/m68klinux-tdep.c
index fd9c146..94fb953 100644
--- a/gdb/m68klinux-tdep.c
+++ b/gdb/m68klinux-tdep.c
@@ -256,7 +256,6 @@ m68k_linux_sigtramp_frame_cache (struct frame_info *this_frame,
   struct frame_id this_id;
   struct trad_frame_cache *cache;
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   struct m68k_linux_sigtramp_info info;
   gdb_byte buf[4];
diff --git a/gdb/machoread.c b/gdb/machoread.c
index 28e0640..8abae47 100644
--- a/gdb/machoread.c
+++ b/gdb/machoread.c
@@ -162,7 +162,6 @@ macho_symtab_read (struct objfile *objfile,
 		   VEC (oso_el) **oso_vector_ptr)
 {
   long i;
-  const asymbol *dir_so = NULL;
   const asymbol *file_so = NULL;
   asymbol **oso_file = NULL;
   unsigned int nbr_syms = 0;
@@ -208,7 +207,6 @@ macho_symtab_read (struct objfile *objfile,
               else
                 {
                   file_so = sym;
-                  dir_so = NULL;
                   state = S_FIRST_SO;
                 }
             }
@@ -245,7 +243,6 @@ macho_symtab_read (struct objfile *objfile,
               else if (state == S_FIRST_SO)
                 {
                   /* Second SO stab for the file name.  */
-                  dir_so = file_so;
                   file_so = sym;
                   state = S_SECOND_SO;
                 }
@@ -292,7 +289,6 @@ macho_symtab_read (struct objfile *objfile,
                 {
                   complaint (&symfile_complaints, _("Missing nul SO"));
                   file_so = sym;
-                  dir_so = NULL;
                   state = S_FIRST_SO;
                 }
             }
@@ -838,7 +834,6 @@ static void
 macho_symfile_read (struct objfile *objfile, int symfile_flags)
 {
   bfd *abfd = objfile->obfd;
-  CORE_ADDR offset;
   long storage_needed;
   bfd *dsym_bfd;
   VEC (oso_el) *oso_vector = NULL;
@@ -891,8 +886,6 @@ macho_symfile_read (struct objfile *objfile, int symfile_flags)
       dsym_bfd = macho_check_dsym (objfile, &dsym_filename);
       if (dsym_bfd != NULL)
 	{
-	  int ix;
-	  oso_el *oso;
           struct bfd_section *asect, *dsect;
 
 	  make_cleanup (xfree, dsym_filename);
@@ -963,7 +956,6 @@ macho_symfile_offsets (struct objfile *objfile,
                        const struct section_addr_info *addrs)
 {
   unsigned int i;
-  unsigned int num_sections;
   struct obj_section *osect;
 
   /* Allocate section_offsets.  */
diff --git a/gdb/maint.c b/gdb/maint.c
index 358809d..5da1c11 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -958,7 +958,6 @@ static void
 set_per_command_cmd (char *args, int from_tty)
 {
   struct cmd_list_element *list;
-  size_t length;
   int val;
 
   val = parse_cli_boolean_value (args);
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index 4619d64..390fc7e 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -218,11 +218,9 @@ mi_cmd_stack_list_locals (char *command, char **argv, int argc)
   enum print_values print_value;
   int oind = 0;
   int skip_unavailable = 0;
-  int i;
 
   if (argc > 1)
     {
-      int i;
       enum opt
       {
 	NO_FRAME_FILTERS,
@@ -418,7 +416,6 @@ mi_cmd_stack_list_variables (char *command, char **argv, int argc)
 
   if (argc > 1)
     {
-      int i;
       enum opt
       {
 	NO_FRAME_FILTERS,
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 7cb7bf5..dd5a6d7 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -443,7 +443,6 @@ run_one_inferior (struct inferior *inf, void *arg)
 void
 mi_cmd_exec_run (char *command, char **argv, int argc)
 {
-  int i;
   int start_p = 0;
 
   /* Parse the command options.  */
@@ -1250,7 +1249,6 @@ static void
 output_register (struct frame_info *frame, int regnum, int format,
 		 int skip_unavailable)
 {
-  struct gdbarch *gdbarch = get_frame_arch (frame);
   struct ui_out *uiout = current_uiout;
   struct value *val = value_of_register (regnum, frame);
   struct cleanup *tuple_cleanup;
@@ -2193,7 +2191,6 @@ static void
 mi_cmd_execute (struct mi_parse *parse)
 {
   struct cleanup *cleanup;
-  enum language saved_language;
 
   cleanup = prepare_execute_command ();
 
@@ -2497,7 +2494,6 @@ print_diff (struct mi_timestamp *start, struct mi_timestamp *end)
 void
 mi_cmd_trace_define_variable (char *command, char **argv, int argc)
 {
-  struct expression *expr;
   LONGEST initval = 0;
   struct trace_state_variable *tsv;
   char *name = 0;
@@ -2697,7 +2693,6 @@ print_variable_or_computed (char *expression, enum print_values values)
   struct cleanup *old_chain;
   struct value *val;
   struct ui_file *stb;
-  struct value_print_options opts;
   struct type *type;
   struct ui_out *uiout = current_uiout;
 
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 1d9155f..b478402 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -974,7 +974,6 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name,
 				 int section,
 				 struct objfile *objfile)
 {
-  struct obj_section *obj_section;
   struct msym_bunch *newobj;
   struct minimal_symbol *msymbol;
 
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 6098f71..cbcab8e 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -559,19 +559,6 @@ static const char *mips_generic_reg_names[NUM_MIPS_PROCESSOR_REGS] = {
   "fsr", "fir",
 };
 
-/* Names of IDT R3041 registers.  */
-
-static const char *mips_r3041_reg_names[] = {
-  "sr", "lo", "hi", "bad", "cause", "pc",
-  "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
-  "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
-  "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
-  "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
-  "fsr", "fir", "", /*"fp" */ "",
-  "", "", "bus", "ccfg", "", "", "", "",
-  "", "", "port", "cmp", "", "", "epc", "prid",
-};
-
 /* Names of tx39 registers.  */
 
 static const char *mips_tx39_reg_names[NUM_MIPS_PROCESSOR_REGS] = {
@@ -2939,7 +2926,6 @@ micromips_scan_prologue (struct gdbarch *gdbarch,
   int non_prologue_insns = 0;
   long frame_offset = 0;	/* Size of stack frame.  */
   long frame_adjust = 0;	/* Offset of FP from SP.  */
-  CORE_ADDR frame_addr = 0;	/* Value of $30, used as frame pointer.  */
   int prev_delay_slot = 0;
   int in_delay_slot;
   CORE_ADDR prev_pc;
@@ -3068,7 +3054,6 @@ micromips_scan_prologue (struct gdbarch *gdbarch,
 	      else if (sreg == MIPS_SP_REGNUM && dreg == 30)
 				/* (D)ADDIU $fp, $sp, imm */
 		{
-		  frame_addr = sp + offset;
 		  frame_adjust = offset;
 		  frame_reg = 30;
 		}
@@ -3145,7 +3130,6 @@ micromips_scan_prologue (struct gdbarch *gdbarch,
 	      if (sreg == MIPS_SP_REGNUM && dreg == 30)
 				/* MOVE  $fp, $sp */
 		{
-		  frame_addr = sp;
 		  frame_reg = 30;
 		}
 	      else if ((sreg & 0x1c) != 0x4)
@@ -3784,7 +3768,6 @@ mips_stub_frame_sniffer (const struct frame_unwind *self,
 			 struct frame_info *this_frame, void **this_cache)
 {
   gdb_byte dummy[4];
-  struct obj_section *s;
   CORE_ADDR pc = get_frame_address_in_block (this_frame);
   struct bound_minimal_symbol msym;
 
@@ -5503,7 +5486,6 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 	  while (len > 0)
 	    {
 	      /* Remember if the argument was written to the stack.  */
-	      int stack_used_p = 0;
 	      int partial_len = (len < MIPS32_REGSIZE ? len : MIPS32_REGSIZE);
 
 	      if (mips_debug)
@@ -5518,7 +5500,6 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		     promoted to int before being stored?  */
 		  int longword_offset = 0;
 		  CORE_ADDR addr;
-		  stack_used_p = 1;
 
 		  if (mips_debug)
 		    {
@@ -5961,7 +5942,6 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 	  while (len > 0)
 	    {
 	      /* Remember if the argument was written to the stack.  */
-	      int stack_used_p = 0;
 	      int partial_len = (len < MIPS64_REGSIZE ? len : MIPS64_REGSIZE);
 
 	      if (mips_debug)
@@ -5976,7 +5956,6 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		     promoted to int before being stored?  */
 		  int longword_offset = 0;
 		  CORE_ADDR addr;
-		  stack_used_p = 1;
 		  if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
 		    {
 		      if ((typecode == TYPE_CODE_INT
@@ -6080,7 +6059,6 @@ mips_o64_return_value (struct gdbarch *gdbarch, struct value *function,
 {
   CORE_ADDR func_addr = function ? find_function_addr (function, NULL) : 0;
   int mips16 = mips_pc_is_mips16 (gdbarch, func_addr);
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   enum mips_fval_reg fval_reg;
 
   fval_reg = readbuf ? mips16 ? mips_fval_gpr : mips_fval_fpr : mips_fval_both;
@@ -6609,12 +6587,10 @@ static int
 mips_single_step_through_delay (struct gdbarch *gdbarch,
 				struct frame_info *frame)
 {
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR pc = get_frame_pc (frame);
   struct address_space *aspace;
   enum mips_isa isa;
   ULONGEST insn;
-  int status;
   int size;
 
   if ((mips_pc_is_mips (pc)
@@ -9048,7 +9024,6 @@ void
 _initialize_mips_tdep (void)
 {
   static struct cmd_list_element *mipsfpulist = NULL;
-  struct cmd_list_element *c;
 
   mips_abi_string = mips_abi_strings[MIPS_ABI_UNKNOWN];
   if (MIPS_ABI_LAST + 1
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 62d4ca1..9ef88a8 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -1150,11 +1150,9 @@ static struct value *
 mn10300_frame_prev_register (struct frame_info *this_frame,
 		             void **this_prologue_cache, int regnum)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame));
   struct mn10300_prologue *p
     = mn10300_analyze_frame_prologue (this_frame, this_prologue_cache);
   CORE_ADDR frame_base = mn10300_frame_base (this_frame, this_prologue_cache);
-  int reg_size = register_size (get_frame_arch (this_frame), regnum);
 
   if (regnum == E_SP_REGNUM)
     return frame_unwind_got_constant (this_frame, regnum, frame_base);
diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c
index 4042ec3..84189dc 100644
--- a/gdb/msp430-tdep.c
+++ b/gdb/msp430-tdep.c
@@ -248,7 +248,6 @@ msp430_pseudo_register_write (struct gdbarch *gdbarch,
 			      struct regcache *regcache,
 			      int regnum, const gdb_byte *buffer)
 {
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   if (MSP430_NUM_REGS <= regnum && regnum < MSP430_NUM_TOTAL_REGS)
 
     {
diff --git a/gdb/mt-tdep.c b/gdb/mt-tdep.c
index 24eb8e1..5d7f31c 100644
--- a/gdb/mt-tdep.c
+++ b/gdb/mt-tdep.c
@@ -676,12 +676,11 @@ mt_registers_info (struct gdbarch *gdbarch,
 	{
 	  /* Special output handling for 38-bit context register.  */
 	  unsigned char *buff;
-	  unsigned int *bytes, i, regsize;
+	  unsigned int i, regsize;
 
 	  regsize = register_size (gdbarch, regnum);
 
 	  buff = (unsigned char *) alloca (regsize);
-	  bytes = XALLOCAVEC (unsigned int, regsize);
 
 	  deprecated_frame_register_read (frame, regnum, buff);
 
diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c
index 9d92c55..8bfd8b3 100644
--- a/gdb/nios2-tdep.c
+++ b/gdb/nios2-tdep.c
@@ -1193,10 +1193,8 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc,
      Note that this number should not be too large, else we can
      potentially end up iterating through unmapped memory.  */
   int ninsns, max_insns = 50;
-  int regno;
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   unsigned long mach = gdbarch_bfd_arch_info (gdbarch)->mach;
-  int is_r2 = (mach == bfd_mach_nios2r2);
 
   /* Does the frame set up the FP register?  */
   int base_reg = 0;
@@ -1841,11 +1839,9 @@ nios2_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   for (argnum = 0; argnum < nargs; argnum++)
     {
       const gdb_byte *val;
-      gdb_byte valbuf[MAX_REGISTER_SIZE];
       struct value *arg = args[argnum];
       struct type *arg_type = check_typedef (value_type (arg));
       int len = TYPE_LENGTH (arg_type);
-      enum type_code typecode = TYPE_CODE (arg_type);
 
       val = value_contents (arg);
 
@@ -1915,7 +1911,6 @@ nios2_frame_unwind_cache (struct frame_info *this_frame,
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
   CORE_ADDR current_pc;
   struct nios2_unwind_cache *cache;
-  int i;
 
   if (*this_prologue_cache)
     return (struct nios2_unwind_cache *) *this_prologue_cache;
@@ -2023,7 +2018,6 @@ nios2_stub_frame_cache (struct frame_info *this_frame, void **this_cache)
   CORE_ADDR stack_addr;
   struct trad_frame_cache *this_trad_cache;
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
-  int num_regs = gdbarch_num_regs (gdbarch);
 
   if (*this_cache != NULL)
     return (struct trad_frame_cache *) *this_cache;
@@ -2081,7 +2075,6 @@ nios2_stub_frame_sniffer (const struct frame_unwind *self,
 			  struct frame_info *this_frame, void **cache)
 {
   gdb_byte dummy[4];
-  struct obj_section *s;
   CORE_ADDR pc = get_frame_address_in_block (this_frame);
 
   /* Use the stub unwinder for unreadable code.  */
@@ -2242,7 +2235,7 @@ nios2_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
   struct gdbarch *gdbarch;
   struct gdbarch_tdep *tdep;
-  int register_bytes, i;
+  int i;
   struct tdesc_arch_data *tdesc_data = NULL;
   const struct target_desc *tdesc = info.target_desc;
 
diff --git a/gdb/ppc-ravenscar-thread.c b/gdb/ppc-ravenscar-thread.c
index dbe8f3d..4b68784 100644
--- a/gdb/ppc-ravenscar-thread.c
+++ b/gdb/ppc-ravenscar-thread.c
@@ -148,7 +148,6 @@ ppc_ravenscar_generic_fetch_registers
    struct regcache *regcache, int regnum)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  const int sp_regnum = gdbarch_sp_regnum (gdbarch);
   const int num_regs = gdbarch_num_regs (gdbarch);
   int current_regnum;
   CORE_ADDR current_address;
diff --git a/gdb/ppcfbsd-tdep.c b/gdb/ppcfbsd-tdep.c
index 059230c..10b41b0 100644
--- a/gdb/ppcfbsd-tdep.c
+++ b/gdb/ppcfbsd-tdep.c
@@ -212,7 +212,6 @@ ppcfbsd_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
 {
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   struct trad_frame_cache *cache;
   CORE_ADDR addr, base, func;
   gdb_byte buf[PPC_INSN_SIZE];
diff --git a/gdb/python/py-evts.c b/gdb/python/py-evts.c
index 2241e0c..95827e4 100644
--- a/gdb/python/py-evts.c
+++ b/gdb/python/py-evts.c
@@ -40,8 +40,6 @@ static struct PyModuleDef EventModuleDef =
 static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION
 add_new_registry (eventregistry_object **registryp, char *name)
 {
-  int result;
-
   *registryp = create_eventregistry_object ();
 
   if (*registryp == NULL)
diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c
index a0513b5..74d225b 100644
--- a/gdb/python/py-finishbreakpoint.c
+++ b/gdb/python/py-finishbreakpoint.c
@@ -158,7 +158,6 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
   static char *keywords[] = { "frame", "internal", NULL };
   struct finish_breakpoint_object *self_bpfinish =
       (struct finish_breakpoint_object *) self;
-  int type = bp_breakpoint;
   PyObject *frame_obj = NULL;
   int thread;
   struct frame_info *frame = NULL; /* init for gcc -Wall */
@@ -357,7 +356,6 @@ bpfinishpy_detect_out_scope_cb (struct breakpoint *b, void *args)
 {
   struct breakpoint *bp_stopped = (struct breakpoint *) args;
   PyObject *py_bp = (PyObject *) b->py_bp_object;
-  struct gdbarch *garch = b->gdbarch ? b->gdbarch : get_current_arch ();
 
   /* Trigger out_of_scope if this is a FinishBreakpoint and its frame is
      not anymore in the current callstack.  */
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
index 8a6a9a4..b663f50 100644
--- a/gdb/python/py-framefilter.c
+++ b/gdb/python/py-framefilter.c
@@ -211,13 +211,11 @@ py_print_type (struct ui_out *out, struct value *val)
 
   TRY
     {
-      struct type *type;
       struct ui_file *stb;
       struct cleanup *cleanup;
 
       stb = mem_fileopen ();
       cleanup = make_cleanup_ui_file_delete (stb);
-      type = check_typedef (value_type (val));
       type_print (value_type (val), "", stb, -1);
       ui_out_field_stream (out, "type", stb);
       do_cleanups (cleanup);
@@ -249,11 +247,6 @@ py_print_value (struct ui_out *out, struct value *val,
 		const struct language_defn *language)
 {
   int should_print = 0;
-  int local_indent = (4 * indent);
-
-  /* Never set an indent level for common_val_print if MI.  */
-  if (ui_out_is_mi_like_p (out))
-    local_indent = 0;
 
   /* MI does not print certain values, differentiated by type,
      depending on what ARGS_TYPE indicates.  Test type against option.
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c
index 55b6ab8..8732b87 100644
--- a/gdb/python/py-inferior.c
+++ b/gdb/python/py-inferior.c
@@ -579,8 +579,6 @@ infpy_write_memory (PyObject *self, PyObject *args, PyObject *kw)
   buffer = (const gdb_byte *) pybuf.buf;
   buf_len = pybuf.len;
 #else
-  const void *vbuffer;
-
   if (! PyArg_ParseTupleAndKeywords (args, kw, "Os#|O", keywords,
 				     &addr_obj, &buffer, &buf_len,
 				     &length_obj))
diff --git a/gdb/python/py-infevents.c b/gdb/python/py-infevents.c
index 442e45a..33d994c 100644
--- a/gdb/python/py-infevents.c
+++ b/gdb/python/py-infevents.c
@@ -36,8 +36,6 @@ static PyObject *
 create_inferior_call_event_object (inferior_call_kind flag, ptid_t ptid,
 				   CORE_ADDR addr)
 {
-  int pid;
-  long tid, lwp;
   PyObject *event;
   PyObject *ptid_obj = NULL;
   PyObject *addr_obj = NULL;
diff --git a/gdb/python/py-infthread.c b/gdb/python/py-infthread.c
index 3a9bae7..697298d 100644
--- a/gdb/python/py-infthread.c
+++ b/gdb/python/py-infthread.c
@@ -145,8 +145,6 @@ thpy_get_global_num (PyObject *self, void *closure)
 static PyObject *
 thpy_get_ptid (PyObject *self, void *closure)
 {
-  int pid;
-  long tid, lwp;
   thread_object *thread_obj = (thread_object *) self;
 
   THPY_REQUIRE_VALID (thread_obj);
diff --git a/gdb/python/py-linetable.c b/gdb/python/py-linetable.c
index 49b6084..662ae88 100644
--- a/gdb/python/py-linetable.c
+++ b/gdb/python/py-linetable.c
@@ -169,7 +169,6 @@ ltpy_get_pcs_for_line (PyObject *self, PyObject *args)
   struct symtab *symtab;
   gdb_py_longest py_line;
   struct linetable_entry *best_entry = NULL;
-  linetable_entry_object *result;
   VEC (CORE_ADDR) *pcs = NULL;
   PyObject *tuple;
 
@@ -239,7 +238,6 @@ ltpy_get_all_source_lines (PyObject *self, PyObject *args)
   Py_ssize_t index;
   PyObject *source_list, *source_dict, *line;
   struct linetable_entry *item;
-  Py_ssize_t list_size;
 
   LTPY_REQUIRE_VALID (self, symtab);
 
@@ -295,7 +293,6 @@ static PyObject *
 ltpy_is_valid (PyObject *self, PyObject *args)
 {
   struct symtab *symtab = NULL;
-  linetable_object *obj = (linetable_object *) self;
 
   symtab = symtab_object_to_symtab (get_symtab (self));
 
@@ -427,7 +424,6 @@ ltpy_iternext (PyObject *self)
 {
   ltpy_iterator_object *iter_obj = (ltpy_iterator_object *) self;
   struct symtab *symtab;
-  int index;
   PyObject *obj;
   struct linetable_entry *item;
 
diff --git a/gdb/python/py-symtab.c b/gdb/python/py-symtab.c
index c3c94e5..af70170 100644
--- a/gdb/python/py-symtab.c
+++ b/gdb/python/py-symtab.c
@@ -437,7 +437,6 @@ PyObject *
 symtab_and_line_to_sal_object (struct symtab_and_line sal)
 {
   sal_object *sal_obj;
-  int success = 0;
 
   sal_obj = PyObject_New (sal_object, &sal_object_type);
   if (sal_obj)
diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c
index 34ba575..cc685ae 100644
--- a/gdb/python/py-unwind.c
+++ b/gdb/python/py-unwind.c
@@ -177,7 +177,6 @@ pyuw_object_attribute_to_pointer (PyObject *pyo, const char *attr_name,
   if (PyObject_HasAttrString (pyo, attr_name))
     {
       PyObject *pyo_value = PyObject_GetAttrString (pyo, attr_name);
-      struct value *value;
 
       if (pyo_value != NULL && pyo_value != Py_None)
         {
@@ -201,8 +200,6 @@ unwind_infopy_str (PyObject *self)
 {
   struct ui_file *strfile = mem_fileopen ();
   unwind_info_object *unwind_info = (unwind_info_object *) self;
-  pending_frame_object *pending_frame
-      = (pending_frame_object *) (unwind_info->pending_frame);
   PyObject *result;
 
   fprintf_unfiltered (strfile, "Frame ID: ");
diff --git a/gdb/python/py-varobj.c b/gdb/python/py-varobj.c
index e87c1f5..7e74454 100644
--- a/gdb/python/py-varobj.c
+++ b/gdb/python/py-varobj.c
@@ -168,7 +168,6 @@ struct varobj_iter *
 py_varobj_get_iterator (struct varobj *var, PyObject *printer)
 {
   PyObject *children;
-  int i;
   PyObject *iter;
   struct py_varobj_iter *py_iter;
   struct cleanup *back_to = varobj_ensure_python_env (var);
diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
index 0ce712f..3e0687d 100644
--- a/gdb/ravenscar-thread.c
+++ b/gdb/ravenscar-thread.c
@@ -338,7 +338,6 @@ ravenscar_mourn_inferior (struct target_ops *ops)
 static void
 ravenscar_inferior_created (struct target_ops *target, int from_tty)
 {
-  struct ravenscar_arch_ops *ops;
 
   if (!ravenscar_task_support
       || gdbarch_ravenscar_ops (target_gdbarch ()) == NULL
diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c
index f5e5489..acd52bb 100644
--- a/gdb/rs6000-aix-tdep.c
+++ b/gdb/rs6000-aix-tdep.c
@@ -290,8 +290,6 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
       else
 	{
 	  /* Argument can fit in one register.  No problem.  */
-	  int adj = gdbarch_byte_order (gdbarch)
-		    == BFD_ENDIAN_BIG ? reg_size - len : 0;
 	  gdb_byte word[MAX_REGISTER_SIZE];
 
 	  memset (word, 0, reg_size);
diff --git a/gdb/rs6000-lynx178-tdep.c b/gdb/rs6000-lynx178-tdep.c
index 3fb125a..91eebbf 100644
--- a/gdb/rs6000-lynx178-tdep.c
+++ b/gdb/rs6000-lynx178-tdep.c
@@ -142,8 +142,6 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
       else
 	{
 	  /* Argument can fit in one register.  No problem.  */
-	  int adj = gdbarch_byte_order (gdbarch)
-		    == BFD_ENDIAN_BIG ? reg_size - len : 0;
 	  gdb_byte word[MAX_REGISTER_SIZE];
 
 	  memset (word, 0, reg_size);
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 2460eb5..645fe92 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1165,7 +1165,6 @@ ppc_deal_with_atomic_sequence (struct frame_info *frame)
   int index;
   int last_breakpoint = 0; /* Defaults to 0 (no breakpoints placed).  */  
   const int atomic_sequence_length = 16; /* Instruction sequence length.  */
-  int opcode; /* Branch instruction's OPcode.  */
   int bc_insn_count = 0; /* Conditional branch instruction count.  */
 
   /* Assume all atomic sequences start with a lwarx/ldarx instruction.  */
diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index fc57592..2106333 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -844,7 +844,6 @@ s390_supply_tdb_regset (const struct regset *regset, struct regcache *regcache,
 {
   ULONGEST tdw;
   enum register_status ret;
-  int i;
 
   regcache_supply_regset (regset, regcache, regnum, regs, len);
   ret = regcache_cooked_read_unsigned (regcache, S390_TDB_DWORD0_REGNUM, &tdw);
@@ -2388,7 +2387,6 @@ static struct value *
 s390_frame_prev_register (struct frame_info *this_frame,
 			  void **this_prologue_cache, int regnum)
 {
-  struct gdbarch *gdbarch = get_frame_arch (this_frame);
   struct s390_unwind_cache *info
     = s390_frame_unwind_cache (this_frame, this_prologue_cache);
 
@@ -3035,8 +3033,6 @@ s390_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
 			    struct dwarf2_frame_state_reg *reg,
 			    struct frame_info *this_frame)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
   /* The condition code (and thus PSW mask) is call-clobbered.  */
   if (regnum == S390_PSWM_REGNUM)
     reg->how = DWARF2_FRAME_REG_UNDEFINED;
@@ -3788,7 +3784,6 @@ s390_record_gpr_h (struct gdbarch *gdbarch, struct regcache *regcache, int i)
 static int
 s390_record_vr (struct gdbarch *gdbarch, struct regcache *regcache, int i)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   if (i < 16)
     {
       if (record_full_arch_list_add_reg (regcache, S390_F0_REGNUM + i))
@@ -3808,7 +3803,6 @@ static int
 s390_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
                     CORE_ADDR addr)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   uint16_t insn[3] = {0};
   /* Instruction as bytes.  */
   uint8_t ibyte[6];
diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c
index 9b7008c..0d817f8 100644
--- a/gdb/score-tdep.c
+++ b/gdb/score-tdep.c
@@ -549,12 +549,9 @@ score_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
       enum type_code typecode = TYPE_CODE (arg_type);
       const gdb_byte *val = value_contents (arg);
       int downward_offset = 0;
-      int odd_sized_struct_p;
       int arg_last_part_p = 0;
 
       arglen = TYPE_LENGTH (arg_type);
-      odd_sized_struct_p = (arglen > SCORE_REGSIZE
-                            && arglen % SCORE_REGSIZE != 0);
 
       /* If a arg should be aligned to 8 bytes (long long or double),
          the value should be put to even register numbers.  */
@@ -1088,12 +1085,10 @@ score3_analyze_prologue (CORE_ADDR startaddr, CORE_ADDR pc,
   int fp_offset_p = 0;
   int inst_len = 0;
 
-  CORE_ADDR prev_pc = -1;
-
   sp = get_frame_register_unsigned (this_frame, SCORE_SP_REGNUM);
   fp = get_frame_register_unsigned (this_frame, SCORE_FP_REGNUM);
 
-  for (; cur_pc < pc; prev_pc = cur_pc, cur_pc += inst_len)
+  for (; cur_pc < pc; cur_pc += inst_len)
     {
       inst_t *inst = NULL;
 
@@ -1181,7 +1176,6 @@ score3_analyze_prologue (CORE_ADDR startaddr, CORE_ADDR pc,
               /* addi! r2, offset */
               if (pc - cur_pc >= 2)
                 {
-		  unsigned int save_v = inst->v;
 		  inst_t *inst2;
 		  
 		  cur_pc += inst->len;
@@ -1267,7 +1261,6 @@ score3_analyze_prologue (CORE_ADDR startaddr, CORE_ADDR pc,
               /* addi r2, offset */
               if (pc - cur_pc >= 2)
                 {
-		  unsigned int save_v = inst->v;
 		  inst_t *inst2;
 		  
 		  cur_pc += inst->len;
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 336b48e..694f5f7 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -1305,8 +1305,6 @@ sh_extract_return_value_nofpu (struct type *type, struct regcache *regcache,
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   int len = TYPE_LENGTH (type);
-  int return_register = R0_REGNUM;
-  int offset;
 
   if (len <= 4)
     {
diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c
index 9a6d803..e6b1e27 100644
--- a/gdb/sh64-tdep.c
+++ b/gdb/sh64-tdep.c
@@ -861,9 +861,6 @@ sh64_analyze_prologue (struct gdbarch *gdbarch,
   int insn;
   int r0_val = 0;
   int insn_size;
-  int gdb_register_number;
-  int register_number;
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   
   cache->sp_offset = 0;
@@ -1058,8 +1055,6 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   int stack_offset, stack_alloc;
   int int_argreg;
-  int float_argreg;
-  int double_argreg;
   int float_arg_index = 0;
   int double_arg_index = 0;
   int argnum;
@@ -1093,8 +1088,6 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
      in eight registers available.  Loop thru args from first to last.  */
 
   int_argreg = ARG0_REGNUM;
-  float_argreg = gdbarch_fp0_regnum (gdbarch);
-  double_argreg = DR0_REGNUM;
 
   for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++)
     {
@@ -1225,7 +1218,6 @@ sh64_extract_return_value (struct type *type, struct regcache *regcache,
 			   gdb_byte *valbuf)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   int len = TYPE_LENGTH (type);
 
   if (TYPE_CODE (type) == TYPE_CODE_FLT)
@@ -1919,7 +1911,6 @@ sh64_do_fp_register (struct gdbarch *gdbarch, struct ui_file *file,
   unsigned char *raw_buffer;
   double flt;	/* Double extracted from raw hex data.  */
   int inv;
-  int j;
 
   /* Allocate space for the float.  */
   raw_buffer = (unsigned char *)
diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c
index 25fbe24..51ab93e 100644
--- a/gdb/solib-aix.c
+++ b/gdb/solib-aix.c
@@ -469,7 +469,6 @@ solib_aix_get_section_offsets (struct objfile *objfile,
 {
   struct section_offsets *offsets;
   bfd *abfd = objfile->obfd;
-  int i;
 
   offsets = XCNEWVEC (struct section_offsets, objfile->num_sections);
 
diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c
index a3953f5..cd5dc8d 100644
--- a/gdb/solib-darwin.c
+++ b/gdb/solib-darwin.c
@@ -363,7 +363,6 @@ static CORE_ADDR
 darwin_read_exec_load_addr_from_dyld (struct darwin_info *info)
 {
   struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
-  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
   int ptr_len = TYPE_LENGTH (ptr_type);
   unsigned int image_info_size = ptr_len * 3;
   int i;
@@ -524,7 +523,6 @@ darwin_solib_read_all_image_info_addr (struct darwin_info *info)
 {
   gdb_byte buf[8];
   LONGEST len;
-  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
   struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
 
   /* Sanity check.  */
diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c
index b11eae7..ad79af0 100644
--- a/gdb/solib-dsbt.c
+++ b/gdb/solib-dsbt.c
@@ -793,7 +793,6 @@ cmp_name (const asymbol *sym, const void *data)
 static int
 enable_break (void)
 {
-  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
   asection *interp_sect;
   struct dsbt_info *info;
 
@@ -819,7 +818,6 @@ enable_break (void)
       char *buf;
       bfd *tmp_bfd = NULL;
       CORE_ADDR addr;
-      gdb_byte addr_buf[TIC6X_PTR_SIZE];
       struct int_elf32_dsbt_loadmap *ldm;
       int ret;
 
diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
index 30662ba..56ccb88 100644
--- a/gdb/solib-frv.c
+++ b/gdb/solib-frv.c
@@ -517,8 +517,6 @@ static int
 enable_break2 (void)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
-  int success = 0;
-  char **bkpt_namep;
   asection *interp_sect;
 
   if (enable_break2_done)
@@ -975,7 +973,6 @@ frv_fdpic_find_canonical_descriptor (CORE_ADDR entry_point)
   const char *name;
   CORE_ADDR addr;
   CORE_ADDR got_value;
-  struct int_elf32_fdpic_loadmap *ldm = 0;
   struct symbol *sym;
 
   /* Fetch the corresponding global pointer for the entry point.  */
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index b4ec363..fe36d45 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1916,7 +1916,6 @@ svr4_handle_solib_event (void)
   struct cleanup *old_chain, *usm_chain;
   struct value *val = NULL;
   CORE_ADDR pc, debug_base, lm = 0;
-  int is_initial_ns;
   struct frame_info *frame = get_current_frame ();
 
   /* Do nothing if not using the probes interface.  */
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 863ef8f..5a8acce 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -684,7 +684,6 @@ sparc_skip_stack_check (const CORE_ADDR start_pc)
 {
   CORE_ADDR pc = start_pc;
   unsigned long insn;
-  int offset_stack_checking_sequence = 0;
   int probing_loop = 0;
 
   /* With GCC, all stack checking sequences begin with the same two
diff --git a/gdb/sparc64-linux-tdep.c b/gdb/sparc64-linux-tdep.c
index 1336d73..6fb9f96 100644
--- a/gdb/sparc64-linux-tdep.c
+++ b/gdb/sparc64-linux-tdep.c
@@ -241,7 +241,6 @@ static int
 sparc64_linux_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
 {
   struct gdbarch *gdbarch = get_frame_arch (frame);
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   CORE_ADDR jb_addr;
   gdb_byte buf[8];
 
diff --git a/gdb/sparcobsd-tdep.c b/gdb/sparcobsd-tdep.c
index 6a40eb9..21c8d6a 100644
--- a/gdb/sparcobsd-tdep.c
+++ b/gdb/sparcobsd-tdep.c
@@ -234,8 +234,6 @@ sparc32obsd_collect_uthread(const struct regcache *regcache,
 static void
 sparc32obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
   /* OpenBSD/sparc is very similar to NetBSD/sparc ELF.  */
   sparc32nbsd_elf_init_abi (info, gdbarch);
 
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index 8dad5c3..ea3229c 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -2425,7 +2425,7 @@ info_spu_dma_cmdlist (gdb_byte *buf, int nr, enum bfd_endian byte_order)
       int mfc_cmd_opcode, mfc_cmd_tag, rclass_id, tclass_id;
       int list_lsa, list_size, mfc_lsa, mfc_size;
       ULONGEST mfc_ea;
-      int list_valid_p, noop_valid_p, qw_valid_p, ea_valid_p, cmd_error_p;
+      int list_valid_p, qw_valid_p, ea_valid_p, cmd_error_p;
 
       /* Decode contents of MFC Command Queue Context Save/Restore Registers.
 	 See "Cell Broadband Engine Registers V1.3", section 3.3.2.1.  */
@@ -2450,7 +2450,6 @@ info_spu_dma_cmdlist (gdb_byte *buf, int nr, enum bfd_endian byte_order)
 
       mfc_lsa = spu_mfc_get_bitfield (mfc_cq_dw2, 0, 13);
       mfc_size = spu_mfc_get_bitfield (mfc_cq_dw2, 14, 24);
-      noop_valid_p = spu_mfc_get_bitfield (mfc_cq_dw2, 37, 37);
       qw_valid_p = spu_mfc_get_bitfield (mfc_cq_dw2, 38, 38);
       ea_valid_p = spu_mfc_get_bitfield (mfc_cq_dw2, 39, 39);
       cmd_error_p = spu_mfc_get_bitfield (mfc_cq_dw2, 40, 40);
diff --git a/gdb/stack.c b/gdb/stack.c
index 6e3acc7..b9e74df 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -310,8 +310,6 @@ void
 read_frame_local (struct symbol *sym, struct frame_info *frame,
 		  struct frame_arg *argp)
 {
-  struct value *val = NULL;
-
   argp->sym = sym;
   argp->val = NULL;
   argp->error = NULL;
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 0d67bfd..ead00d3 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1249,7 +1249,6 @@ void
 symbol_file_add_separate (bfd *bfd, const char *name, int symfile_flags,
 			  struct objfile *objfile)
 {
-  struct objfile *new_objfile;
   struct section_addr_info *sap;
   struct cleanup *my_cleanup;
 
@@ -1259,7 +1258,7 @@ symbol_file_add_separate (bfd *bfd, const char *name, int symfile_flags,
   sap = build_section_addr_info_from_objfile (objfile);
   my_cleanup = make_cleanup_free_section_addr_info (sap);
 
-  new_objfile = symbol_file_add_with_addrs
+  symbol_file_add_with_addrs
     (bfd, name, symfile_flags, sap,
      objfile->flags & (OBJF_REORDERED | OBJF_SHARED | OBJF_READNOW
 		       | OBJF_USERLOADED),
@@ -2383,7 +2382,6 @@ remove_symbol_file_command (char *args, int from_tty)
   struct objfile *objf = NULL;
   struct cleanup *my_cleanups;
   struct program_space *pspace = current_program_space;
-  struct gdbarch *gdbarch = get_current_arch ();
 
   dont_repeat ();
 
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index d5efcfd..bba8a71 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -991,7 +991,6 @@ maintenance_print_one_line_table (struct symtab *symtab, void *data)
       for (i = 0; i < linetable->nitems; ++i)
 	{
 	  struct linetable_entry *item;
-	  struct cleanup *row_cleanup;
 
 	  item = &linetable->item [i];
 	  printf_filtered (_("%-6d %6d %s\n"), i, item->line,
diff --git a/gdb/symtab.c b/gdb/symtab.c
index e06104b..ffd427b 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1563,7 +1563,6 @@ symbol_cache_flush (struct program_space *pspace)
   struct symbol_cache *cache
     = (struct symbol_cache *) program_space_data (pspace, symbol_cache_key);
   int pass;
-  size_t total_size;
 
   if (cache == NULL)
     return;
@@ -2905,11 +2904,7 @@ basic_lookup_transparent_type_1 (struct objfile *objfile, int block_index,
 struct type *
 basic_lookup_transparent_type (const char *name)
 {
-  struct symbol *sym;
-  struct compunit_symtab *cust;
-  const struct blockvector *bv;
   struct objfile *objfile;
-  struct block *block;
   struct type *t;
 
   /* Now search all the global symbols.  Do the symtab's first, then
@@ -4419,7 +4414,7 @@ sort_search_symbols_remove_dups (struct symbol_search *found, int nfound,
 				 struct symbol_search **new_head,
 				 struct symbol_search **new_tail)
 {
-  struct symbol_search **symbols, *symp, *old_next;
+  struct symbol_search **symbols, *symp;
   int i, j, nunique;
 
   gdb_assert (found != NULL && nfound > 0);
diff --git a/gdb/target.c b/gdb/target.c
index a9744c4..c0ce46d 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1535,8 +1535,6 @@ target_memory_map (void)
   VEC(mem_region_s) *result;
   struct mem_region *last_one, *this_one;
   int ix;
-  struct target_ops *t;
-
   result = current_target.to_memory_map (&current_target);
   if (result == NULL)
     return NULL;
@@ -2230,8 +2228,6 @@ target_preopen (int from_tty)
 void
 target_detach (const char *args, int from_tty)
 {
-  struct target_ops* t;
-  
   if (gdbarch_has_global_breakpoints (target_gdbarch ()))
     /* Don't remove global breakpoints here.  They're removed on
        disconnection from the target.  */
@@ -2289,8 +2285,6 @@ target_thread_name (struct thread_info *info)
 void
 target_resume (ptid_t ptid, int step, enum gdb_signal signal)
 {
-  struct target_ops *t;
-
   target_dcache_invalidate ();
 
   current_target.to_resume (&current_target, ptid, step, signal);
@@ -2793,7 +2787,7 @@ static int lowest_closed_fd;
 static int
 acquire_fileio_fd (struct target_ops *t, int fd)
 {
-  fileio_fh_t *fh, buf;
+  fileio_fh_t *fh;
 
   gdb_assert (!is_closed_fileio_fh (fd));
 
@@ -3499,8 +3493,6 @@ target_fetch_registers (struct regcache *regcache, int regno)
 void
 target_store_registers (struct regcache *regcache, int regno)
 {
-  struct target_ops *t;
-
   if (!may_write_registers)
     error (_("Writing to registers is not allowed (regno %d)"), regno);
 
diff --git a/gdb/thread.c b/gdb/thread.c
index 75bfb47..5c7d96c 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -1201,7 +1201,6 @@ print_thread_info_1 (struct ui_out *uiout, char *requested_threads,
   ptid_t current_ptid;
   struct cleanup *old_chain;
   const char *extra_info, *name, *target_id;
-  int current_thread = -1;
   struct inferior *inf;
   int default_inf_num = current_inferior ()->num;
 
@@ -1261,9 +1260,6 @@ print_thread_info_1 (struct ui_out *uiout, char *requested_threads,
       struct cleanup *chain2;
       int core;
 
-      if (ptid_equal (tp->ptid, current_ptid))
-	current_thread = tp->global_num;
-
       if (!should_print_thread (requested_threads, default_inf_num,
 				global_ids, pid, tp))
 	continue;
diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c
index 4779bf0..af53938 100644
--- a/gdb/tic6x-tdep.c
+++ b/gdb/tic6x-tdep.c
@@ -151,7 +151,6 @@ tic6x_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc,
 			struct tic6x_unwind_cache *cache,
 			struct frame_info *this_frame)
 {
-  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   unsigned long inst;
   unsigned int src_reg, base_reg, dst_reg;
   int i;
@@ -175,8 +174,6 @@ tic6x_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc,
      2nd one is optional.  */
   while (pc < current_pc)
     {
-      int offset = 0;
-
       unsigned long inst = tic6x_fetch_instruction (gdbarch, pc);
 
       if ((inst & 0x1ffc) == 0x1dc0 || (inst & 0x1ffc) == 0x1bc0
diff --git a/gdb/tilegx-linux-tdep.c b/gdb/tilegx-linux-tdep.c
index d7dc07e..ce76cb4 100644
--- a/gdb/tilegx-linux-tdep.c
+++ b/gdb/tilegx-linux-tdep.c
@@ -37,7 +37,6 @@ tilegx_linux_sigframe_init (const struct tramp_frame *self,
 			    struct trad_frame_cache *this_cache,
 			    CORE_ADDR func)
 {
-  CORE_ADDR pc = get_frame_register_unsigned (this_frame, 64);
   CORE_ADDR sp = get_frame_register_unsigned (this_frame, 54);
 
   /* Base address of register save area.  */
diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c
index bef1516..550be4c 100644
--- a/gdb/tilegx-tdep.c
+++ b/gdb/tilegx-tdep.c
@@ -288,7 +288,7 @@ tilegx_push_dummy_call (struct gdbarch *gdbarch,
   CORE_ADDR stack_dest = sp;
   int argreg = TILEGX_R0_REGNUM;
   int i, j;
-  int typelen, slacklen, alignlen;
+  int typelen, slacklen;
   static const gdb_byte four_zero_words[16] = { 0 };
 
   /* If struct_return is 1, then the struct return address will
@@ -375,9 +375,6 @@ tilegx_analyze_prologue (struct gdbarch* gdbarch,
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   CORE_ADDR next_addr;
   CORE_ADDR prolog_end = end_addr;
-  ULONGEST inst, inst2;
-  LONGEST offset;
-  int regnum;
   gdb_byte instbuf[32 * TILEGX_BUNDLE_SIZE_IN_BYTES];
   CORE_ADDR instbuf_start;
   unsigned int instbuf_size;
@@ -780,7 +777,6 @@ tilegx_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 
   if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
     {
-      ULONGEST inst, inst2;
       CORE_ADDR addr = func_end - TILEGX_BUNDLE_SIZE_IN_BYTES;
 
       /* FIXME: Find the actual epilogue.  */
@@ -866,7 +862,6 @@ tilegx_frame_cache (struct frame_info *this_frame, void **this_cache)
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
   struct tilegx_frame_cache *cache;
   CORE_ADDR current_pc;
-  int i;
 
   if (*this_cache)
     return (struct tilegx_frame_cache *) *this_cache;
diff --git a/gdb/tracefile.c b/gdb/tracefile.c
index 609b7e5..4550286 100644
--- a/gdb/tracefile.c
+++ b/gdb/tracefile.c
@@ -57,14 +57,12 @@ trace_save (const char *filename, struct trace_file_writer *writer,
 	    int target_does_save)
 {
   struct trace_status *ts = current_trace_status ();
-  int status;
   struct uploaded_tp *uploaded_tps = NULL, *utp;
   struct uploaded_tsv *uploaded_tsvs = NULL, *utsv;
 
   ULONGEST offset = 0;
 #define MAX_TRACE_UPLOAD 2000
   gdb_byte buf[MAX_TRACE_UPLOAD];
-  int written;
   enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
 
   /* If the target is to save the data to a file on its own, then just
@@ -77,10 +75,6 @@ trace_save (const char *filename, struct trace_file_writer *writer,
       return;
     }
 
-  /* Get the trace status first before opening the file, so if the
-     target is losing, we can get out without touching files.  */
-  status = target_get_trace_status (ts);
-
   writer->ops->start (writer, filename);
 
   writer->ops->write_header (writer);
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 8b393db..a2189d5 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1651,9 +1651,7 @@ encode_actions_and_make_cleanup (struct bp_location *tloc,
 				 struct collection_list *tracepoint_list,
 				 struct collection_list *stepping_list)
 {
-  char *default_collect_line = NULL;
   struct command_line *actions;
-  struct command_line *default_collect_action = NULL;
   int frame_reg;
   LONGEST frame_offset;
   struct cleanup *back_to, *return_chain;
@@ -1790,9 +1788,6 @@ start_tracing (char *notes)
 
   for (ix = 0; VEC_iterate (breakpoint_p, tp_vec, ix, b); ix++)
     {
-      struct tracepoint *t = (struct tracepoint *) b;
-      struct bp_location *loc;
-
       if (b->enable_state == bp_enabled)
 	any_enabled = 1;
 
@@ -3963,7 +3958,6 @@ static void
 print_one_static_tracepoint_marker (int count,
 				    struct static_tracepoint_marker *marker)
 {
-  struct command_line *l;
   struct symbol *sym;
 
   char wrap_indent[80];
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 96f8df7..e1160d2 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -398,8 +398,6 @@ gdb_getenv_term (void)
 void
 tui_enable (void)
 {
-  struct interp *interp;
-
   if (tui_active)
     return;
 
diff --git a/gdb/valops.c b/gdb/valops.c
index bbbbd00..71fb1b3 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -2217,9 +2217,7 @@ value_struct_elt_bitpos (struct value **argp, int bitpos, struct type *ftype,
 			 const char *err)
 {
   struct type *t;
-  struct value *v;
   int i;
-  int nbases;
 
   *argp = coerce_array (*argp);
 
@@ -2472,7 +2470,6 @@ find_overload_match (struct value **args, int nargs,
   int method_oload_champ = -1;
   int src_method_oload_champ = -1;
   int ext_method_oload_champ = -1;
-  int src_and_ext_equal = 0;
 
   /* The measure for the current best match.  */
   struct badness_vector *method_badness = NULL;
@@ -2571,7 +2568,6 @@ find_overload_match (struct value **args, int nargs,
 	  switch (compare_badness (ext_method_badness, src_method_badness))
 	    {
 	      case 0: /* Src method and xmethod are equally good.  */
-		src_and_ext_equal = 1;
 		/* If src method and xmethod are equally good, then
 		   xmethod should be the winner.  Hence, fall through to the
 		   case where a xmethod is better than the source
@@ -2996,7 +2992,6 @@ find_oload_champ (struct value **args, int nargs,
 {
   int ix;
   int fn_count;
-  int xm_worker_vec_n = VEC_length (xmethod_worker_ptr, xm_worker_vec);
   /* A measure of how good an overloaded instance is.  */
   struct badness_vector *bv;
   /* Index of best overloaded function.  */
diff --git a/gdb/value.c b/gdb/value.c
index e1e7f5e..68cc777 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1333,7 +1333,6 @@ void
 value_contents_copy_raw (struct value *dst, int dst_offset,
 			 struct value *src, int src_offset, int length)
 {
-  range_s *r;
   int src_bit_offset, dst_bit_offset, bit_length;
   struct gdbarch *arch = get_value_arch (src);
   int unit_size = gdbarch_addressable_memory_unit_size (arch);
@@ -3941,7 +3940,6 @@ value_fetch_lazy (struct value *val)
          per bitfield.  It would be even better to read only the containing
          word, but we have no way to record that just specific bits of a
          value have been fetched.  */
-      struct type *type = check_typedef (value_type (val));
       struct value *parent = value_parent (val);
 
       if (value_lazy (parent))
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
index cddbf23..810607a 100644
--- a/gdb/windows-tdep.c
+++ b/gdb/windows-tdep.c
@@ -111,7 +111,7 @@ windows_get_tlb_type (struct gdbarch *gdbarch)
   static struct type *last_tlb_type = NULL;
   struct type *dword_ptr_type, *dword32_type, *void_ptr_type;
   struct type *peb_ldr_type, *peb_ldr_ptr_type;
-  struct type *peb_type, *peb_ptr_type, *list_type, *list_ptr_type;
+  struct type *peb_type, *peb_ptr_type, *list_type;
   struct type *module_list_ptr_type;
   struct type *tib_type, *seh_type, *tib_ptr_type, *seh_ptr_type;
 
@@ -130,9 +130,6 @@ windows_get_tlb_type (struct gdbarch *gdbarch)
   list_type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
   TYPE_NAME (list_type) = xstrdup ("list");
 
-  list_ptr_type = arch_type (gdbarch, TYPE_CODE_PTR,
-			    TYPE_LENGTH (void_ptr_type), NULL);
-
   module_list_ptr_type = void_ptr_type;
 
   append_composite_type_field (list_type, "forward_list",
diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c
index 107576f..fef36f7 100644
--- a/gdb/x86-linux-nat.c
+++ b/gdb/x86-linux-nat.c
@@ -262,7 +262,6 @@ x86_linux_enable_btrace (struct target_ops *self, ptid_t ptid,
 			 const struct btrace_config *conf)
 {
   struct btrace_target_info *tinfo;
-  struct gdbarch *gdbarch;
 
   errno = 0;
   tinfo = linux_enable_btrace (ptid, conf);
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index c670949..507baf2 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -930,7 +930,6 @@ record_minimal_symbol (const char *name, CORE_ADDR address,
 		       int n_scnum,
 		       struct objfile *objfile)
 {
-  int section = secnum_to_section (n_scnum, objfile);
 
   if (name[0] == '.')
     ++name;
@@ -2186,7 +2185,6 @@ scan_xcoff_symtab (struct objfile *objfile)
   const char *filestring = NULL;
 
   const char *namestring;
-  int past_first_source_file = 0;
   bfd *abfd;
   asection *bfd_sect;
   unsigned int nsyms;
diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c
index 3a3bada..32beafd 100644
--- a/gdb/xtensa-tdep.c
+++ b/gdb/xtensa-tdep.c
@@ -2796,7 +2796,6 @@ execute_code (struct gdbarch *gdbarch, CORE_ADDR current_pc, CORE_ADDR wb)
   int ilen, islots, is;
   xtensa_opcode opc;
   int insn_num = 0;
-  int fail = 0;
   void (*func) (struct gdbarch *, int, int, int, CORE_ADDR);
 
   uint32_t at, as, offset;
@@ -3192,7 +3191,6 @@ xtensa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
   struct gdbarch_tdep *tdep;
   struct gdbarch *gdbarch;
-  struct xtensa_abi_handler *abi_handler;
 
   DEBUGTRACE ("gdbarch_init()\n");
 
@@ -3291,8 +3289,6 @@ extern initialize_file_ftype _initialize_xtensa_tdep;
 void
 _initialize_xtensa_tdep (void)
 {
-  struct cmd_list_element *c;
-
   gdbarch_register (bfd_arch_xtensa, xtensa_gdbarch_init, xtensa_dump_tdep);
   xtensa_init_reggroups ();
 
-- 
2.8.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]