]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Remove a bunch more warnings generated by gcc-4.6 about dead
authorJulian Seward <jseward@acm.org>
Mon, 28 Mar 2011 20:33:52 +0000 (20:33 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 28 Mar 2011 20:33:52 +0000 (20:33 +0000)
assignments ("[-Wunused-but-set-variable]"), on ppc32-linux and
ppc64-linux.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11674

coregrind/m_debuginfo/debuginfo.c
coregrind/m_debuginfo/readdwarf.c
coregrind/m_debuginfo/readelf.c
coregrind/m_initimg/initimg-linux.c
coregrind/m_sigframe/sigframe-ppc64-linux.c
coregrind/m_syswrap/syswrap-ppc32-linux.c
coregrind/m_syswrap/syswrap-ppc64-linux.c

index 4aa9286dd0bddd6e05bfc566880b8b47a0d76dbf..9e67d553b5416e01a9f2f3f59088396e2f538284 100644 (file)
@@ -2277,7 +2277,7 @@ Addr ML_(get_CFA) ( Addr ip, Addr sp, Addr fp,
 {
    CFSICacheEnt* ce;
    DebugInfo*    di;
-   DiCfSI*       cfsi;
+   DiCfSI*       cfsi __attribute__((unused));
 
    ce = cfsi_cache__find(ip);
 
@@ -2326,12 +2326,11 @@ Bool VG_(use_CF_info) ( /*MOD*/D3UnwindRegs* uregsHere,
                         Addr min_accessible,
                         Addr max_accessible )
 {
-   Bool               ok;
    DebugInfo*         di;
    DiCfSI*            cfsi = NULL;
    Addr               cfa, ipHere = 0;
    CFSICacheEnt*      ce;
-   CfiExprEvalContext eec;
+   CfiExprEvalContext eec __attribute__((unused));
    D3UnwindRegs       uregsPrev;
 
 #  if defined(VGA_x86) || defined(VGA_amd64)
@@ -2392,7 +2391,7 @@ Bool VG_(use_CF_info) ( /*MOD*/D3UnwindRegs* uregsHere,
                eec.uregs = uregsHere;                   \
                eec.min_accessible = min_accessible;     \
                eec.max_accessible = max_accessible;     \
-               ok = True;                               \
+               Bool ok = True;                          \
                _prev = evalCfiExpr(di->cfsi_exprs, _off, &eec, &ok ); \
                if (!ok) return False;                   \
                break;                                   \
index 4e93bb258491d61be6777fdf243e71211a93cd50..33e12cbc00537c0078650d924af736c44ba8abfe 100644 (file)
@@ -2384,7 +2384,7 @@ static Int copy_convert_CfiExpr_tree ( XArray*        dstxa,
                                        Int            srcix )
 {
    CfiExpr* src;
-   Int      cpL, cpR, cpA, dwreg;
+   Int      cpL, cpR, cpA;
    XArray*  srcxa = srcuc->exprs;
    vg_assert(srcxa);
    vg_assert(dstxa);
@@ -2412,8 +2412,9 @@ static Int copy_convert_CfiExpr_tree ( XArray*        dstxa,
          /* should not see these in input (are created only by this
             conversion step!) */
          VG_(core_panic)("copy_convert_CfiExpr_tree: CfiReg in input");
-      case Cex_DwReg:
+      case Cex_DwReg: {
          /* This is the only place where the conversion can fail. */
+         Int dwreg __attribute__((unused));
          dwreg = src->Cex.DwReg.reg;
 #        if defined(VGA_x86) || defined(VGA_amd64)
          if (dwreg == SP_REG)
@@ -2442,6 +2443,7 @@ static Int copy_convert_CfiExpr_tree ( XArray*        dstxa,
 #        endif
          /* else we must fail - can't represent the reg */
          return -1;
+      }
       default:
          VG_(core_panic)("copy_convert_CfiExpr_tree: default");
    }
index ea4288236613b430bf5755a05a219ecf9960f6ce..fcfb06ca8a27f9dca8a45ff8b37748ca28ee5208 100644 (file)
@@ -1985,10 +1985,10 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
             UChar*      shdr_strtab_dimg = NULL;
 
             /* SVMAs covered by rx and rw segments and corresponding bias. */
-            Addr     rx_dsvma_base = 0;
+            /* Addr     rx_dsvma_base = 0; */ /* UNUSED */
             Addr     rx_dsvma_limit = 0;
             PtrdiffT rx_dbias = 0;
-            Addr     rw_dsvma_base = 0;
+            /* Addr     rw_dsvma_base = 0; */ /* UNUSED */
             Addr     rw_dsvma_limit = 0;
             PtrdiffT rw_dbias = 0;
 
@@ -2045,15 +2045,16 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di )
                       && phdr->p_offset >= di->rx_map_foff
                       && phdr->p_offset < di->rx_map_foff + di->rx_map_size
                       && phdr->p_offset + phdr->p_filesz <= di->rx_map_foff + di->rx_map_size) {
-                     rx_dsvma_base = phdr->p_vaddr;
+                     /* rx_dsvma_base = phdr->p_vaddr; */ /* UNUSED */
                      rx_dsvma_limit = phdr->p_vaddr + phdr->p_memsz;
                      rx_dbias = di->rx_map_avma - di->rx_map_foff + phdr->p_offset - phdr->p_vaddr;
                   }
-                  else if (rw_dsvma_limit == 0
-                           && phdr->p_offset >= di->rw_map_foff
-                           && phdr->p_offset < di->rw_map_foff + di->rw_map_size
-                           && phdr->p_offset + phdr->p_filesz <= di->rw_map_foff + di->rw_map_size) {
-                     rw_dsvma_base = phdr->p_vaddr;
+                  else
+                  if (rw_dsvma_limit == 0
+                      && phdr->p_offset >= di->rw_map_foff
+                      && phdr->p_offset < di->rw_map_foff + di->rw_map_size
+                      && phdr->p_offset + phdr->p_filesz <= di->rw_map_foff + di->rw_map_size) {
+                     /* rw_dsvma_base = phdr->p_vaddr; */ /* UNUSED */
                      rw_dsvma_limit = phdr->p_vaddr + phdr->p_memsz;
                      rw_dbias = di->rw_map_avma - di->rw_map_foff + phdr->p_offset - phdr->p_vaddr;
                   }
index 14532fbfbc87a779e75b2a41d5973f7edef5f459..097699840eb7770c95d1ca76b81757ec43241fd3 100644 (file)
@@ -620,7 +620,6 @@ Addr setup_client_stack( void*  init_sp,
 #  endif
 
    for (; orig_auxv->a_type != AT_NULL; auxv++, orig_auxv++) {
-      const NSegment *ehdrseg;
 
       /* copy the entry... */
       *auxv = *orig_auxv;
@@ -725,13 +724,14 @@ Addr setup_client_stack( void*  init_sp,
             break;
 
 #        if !defined(VGP_ppc32_linux) && !defined(VGP_ppc64_linux)
-         case AT_SYSINFO_EHDR:
+         case AT_SYSINFO_EHDR: {
             /* Trash this, because we don't reproduce it */
-            ehdrseg = VG_(am_find_nsegment)((Addr)auxv->u.a_ptr);
+            const NSegment* ehdrseg = VG_(am_find_nsegment)((Addr)auxv->u.a_ptr);
             vg_assert(ehdrseg);
             VG_(am_munmap_valgrind)(ehdrseg->start, ehdrseg->end - ehdrseg->start);
             auxv->a_type = AT_IGNORE;
             break;
+         }
 #        endif
 
          case AT_RANDOM:
index 03283784ea061325080560acf0f8d2e0e61cba0e..5c6198baed9892a95aa56fdfb99fbf0399dd80d8 100644 (file)
@@ -189,7 +189,7 @@ void VG_(sigframe_create)( ThreadId tid,
    Addr sp;
    ThreadState* tst;
    Int sigNo = siginfo->si_signo;
-   Addr faultaddr;
+   /* Addr faultaddr; */ /* UNUSED */
    struct rt_sigframe* frame;
 
    /* Stack must be 16-byte aligned */
@@ -225,9 +225,11 @@ void VG_(sigframe_create)( ThreadId tid,
    VG_TRACK( post_mem_write, Vg_CoreSignal, tid, 
              sp, sizeof(UWord) );
 
+   /* UNUSED:
    faultaddr = (Addr)siginfo->_sifields._sigfault._addr;
    if (sigNo == VKI_SIGILL && siginfo->si_code > 0)
       faultaddr = tst->arch.vex.guest_CIA;
+   */
 
    VG_(memcpy)(&frame->info, siginfo, sizeof(*siginfo));
    VG_TRACK( post_mem_write, Vg_CoreSignal, tid,
index a6d3ca4a8cbfe2905bea38dea7374624420b102b..ca37a5afc0efc9224d6b90b94c3468e7cd1c1375 100644 (file)
@@ -1061,7 +1061,7 @@ PRE(sys_sigreturn)
    /* See comments on PRE(sys_rt_sigreturn) in syswrap-amd64-linux.c for
       an explanation of what follows. */
 
-   ThreadState* tst;
+   //ThreadState* tst;
    PRINT("sys_sigreturn ( )");
 
    vg_assert(VG_(is_valid_tid)(tid));
@@ -1070,7 +1070,7 @@ PRE(sys_sigreturn)
 
    ///* Adjust esp to point to start of frame; skip back up over
    //   sigreturn sequence's "popl %eax" and handler ret addr */
-   tst = VG_(get_ThreadState)(tid);
+   //tst = VG_(get_ThreadState)(tid);
    //tst->arch.vex.guest_ESP -= sizeof(Addr)+sizeof(Word);
    // Should we do something equivalent on ppc32?  Who knows.
 
@@ -1096,7 +1096,7 @@ PRE(sys_rt_sigreturn)
    /* See comments on PRE(sys_rt_sigreturn) in syswrap-amd64-linux.c for
       an explanation of what follows. */
 
-   ThreadState* tst;
+   //ThreadState* tst;
    PRINT("rt_sigreturn ( )");
 
    vg_assert(VG_(is_valid_tid)(tid));
@@ -1105,7 +1105,7 @@ PRE(sys_rt_sigreturn)
 
    ///* Adjust esp to point to start of frame; skip back up over handler
    //   ret addr */
-   tst = VG_(get_ThreadState)(tid);
+   //tst = VG_(get_ThreadState)(tid);
    //tst->arch.vex.guest_ESP -= sizeof(Addr);
    // Should we do something equivalent on ppc32?  Who knows.
 
index 6ad9c75774aeef1c5ea8d24fd67bd02e8529d2f1..9e9456a4e205813d0d305c311b16e6b839f77b6b 100644 (file)
@@ -1046,7 +1046,7 @@ PRE(sys_rt_sigreturn)
    /* See comments on PRE(sys_rt_sigreturn) in syswrap-amd64-linux.c for
       an explanation of what follows. */
 
-   ThreadState* tst;
+   //ThreadState* tst;
    PRINT("sys_rt_sigreturn ( )");
 
    vg_assert(VG_(is_valid_tid)(tid));
@@ -1055,7 +1055,7 @@ PRE(sys_rt_sigreturn)
 
    ///* Adjust esp to point to start of frame; skip back up over handler
    //   ret addr */
-   tst = VG_(get_ThreadState)(tid);
+   //tst = VG_(get_ThreadState)(tid);
    //tst->arch.vex.guest_ESP -= sizeof(Addr);
    // Should we do something equivalent on ppc64-linux?  Who knows.