From: Julian Seward Date: Mon, 28 Mar 2011 20:33:52 +0000 (+0000) Subject: Remove a bunch more warnings generated by gcc-4.6 about dead X-Git-Tag: svn/VALGRIND_3_7_0~560 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adb0e3b18da8a5194229a1234d0360e61e976788;p=thirdparty%2Fvalgrind.git Remove a bunch more warnings generated by gcc-4.6 about dead assignments ("[-Wunused-but-set-variable]"), on ppc32-linux and ppc64-linux. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11674 --- diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index 4aa9286dd0..9e67d553b5 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -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; \ diff --git a/coregrind/m_debuginfo/readdwarf.c b/coregrind/m_debuginfo/readdwarf.c index 4e93bb2584..33e12cbc00 100644 --- a/coregrind/m_debuginfo/readdwarf.c +++ b/coregrind/m_debuginfo/readdwarf.c @@ -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"); } diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c index ea42882366..fcfb06ca8a 100644 --- a/coregrind/m_debuginfo/readelf.c +++ b/coregrind/m_debuginfo/readelf.c @@ -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; } diff --git a/coregrind/m_initimg/initimg-linux.c b/coregrind/m_initimg/initimg-linux.c index 14532fbfbc..097699840e 100644 --- a/coregrind/m_initimg/initimg-linux.c +++ b/coregrind/m_initimg/initimg-linux.c @@ -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: diff --git a/coregrind/m_sigframe/sigframe-ppc64-linux.c b/coregrind/m_sigframe/sigframe-ppc64-linux.c index 03283784ea..5c6198baed 100644 --- a/coregrind/m_sigframe/sigframe-ppc64-linux.c +++ b/coregrind/m_sigframe/sigframe-ppc64-linux.c @@ -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, diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c index a6d3ca4a8c..ca37a5afc0 100644 --- a/coregrind/m_syswrap/syswrap-ppc32-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c @@ -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. diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c index 6ad9c75774..9e9456a4e2 100644 --- a/coregrind/m_syswrap/syswrap-ppc64-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c @@ -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.