]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: common: fix -Wunused-variable warnings
authorMike Frysinger <vapier@gentoo.org>
Wed, 6 Dec 2023 13:39:49 +0000 (06:39 -0700)
committerMike Frysinger <vapier@gentoo.org>
Tue, 19 Dec 2023 10:51:09 +0000 (05:51 -0500)
sim/common/cgen-run.c
sim/common/cgen-scache.c
sim/common/sim-module.c
sim/common/sim-options.c
sim/common/sim-watch.c
sim/common/syscall.c

index 29578b0c57f28129c9a0e4baf85d8fc700df1cc1..b0b7cf1ed3653251f504a34dd5948bd2913bdf0d 100644 (file)
@@ -56,8 +56,7 @@ static void engine_run_n (SIM_DESC, int, int, int, int);
 static int
 cgen_get_fast_p (SIM_DESC sd)
 {
-  int i, c;
-  int run_fast_p = 1;
+  int c;
 
   for (c = 0; c < MAX_NR_PROCESSORS; ++c)
     {
index c6de30e165754e3e7c2ded5f2d76840402ecc329..46dada7e2564db974b4ae0d286b280ea22ac9966 100644 (file)
@@ -276,7 +276,10 @@ scache_flush (SIM_DESC sd)
 void
 scache_flush_cpu (SIM_CPU *cpu)
 {
-  int i,n;
+  int i;
+#if WITH_SCACHE_PBB
+  int n;
+#endif
 
   /* Don't bother if cache not in use.  */
   if (CPU_SCACHE_SIZE (cpu) == 0)
@@ -426,9 +429,6 @@ scache_print_profile (SIM_CPU *cpu, bool verbose)
   unsigned long hits = CPU_SCACHE_HITS (cpu);
   unsigned long misses = CPU_SCACHE_MISSES (cpu);
   char buf[20];
-  unsigned long max_val;
-  unsigned long *lengths;
-  int i;
 
   if (CPU_SCACHE_SIZE (cpu) == 0)
     return;
@@ -460,6 +460,10 @@ scache_print_profile (SIM_CPU *cpu, bool verbose)
 
   if (verbose)
     {
+      unsigned long max_val;
+      unsigned long *lengths;
+      int i;
+
       sim_io_printf (sd, "  Insn chain lengths:\n\n");
       max_val = 0;
       lengths = CPU_SCACHE_CHAIN_LENGTHS (cpu);
index f03e4b774b756139bfca3ceb1fbf72fa28f4d797..ac8c9782f440340306cde9b1a6b554d1f709c319 100644 (file)
@@ -133,8 +133,6 @@ sim_module_install_list (SIM_DESC sd, MODULE_INSTALL_FN * const *modules,
 SIM_RC
 sim_module_install (SIM_DESC sd)
 {
-  MODULE_INSTALL_FN * const *modp;
-
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
   SIM_ASSERT (STATE_MODULES (sd) == NULL);
 
index a6cd0037d2aac37594ec5424b650f338d5d81c23..9f238339fb8f564666ebba8d57f55cb2e625f070 100644 (file)
@@ -1078,7 +1078,6 @@ complete_option_list (char **ret, size_t *cnt, const struct option_list *ol,
                      const char *text, const char *word)
 {
   const OPTION *opt = NULL;
-  int argi;
   size_t len = strlen (word);
 
   for ( ; ol != NULL; ol = ol->next)
index 6f9a53ac3b198cdfdf3c8496a2450d229b5b01bf..3366257d3c1ac28b173fb7a81f6d147649994f8e 100644 (file)
@@ -169,8 +169,6 @@ static SIM_RC
 schedule_watchpoint (SIM_DESC sd,
                     sim_watch_point *point)
 {
-  sim_watchpoints *watch = STATE_WATCHPOINTS (sd);
-
   switch (point->type)
     {
     case pc_watchpoint:
index 96033db84c3b3bee1d74039382982a40f381985c..9d08730fc739884569f4ff068a82f29ec141bdef 100644 (file)
@@ -213,9 +213,7 @@ cb_syscall (host_callback *cb, CB_SYSCALL *sc)
        /* Buffer size.  */
        int bufsize = sc->arg2;
        int written = 0;
-       /* Q is the target address of where all the strings go.  */
-       TADDR q;
-       int i, argc, envc, len, ret;
+       int argc, envc, len, ret;
        char **argv = cb->argv;
        char **envp = cb->envp;