|
From: <sv...@va...> - 2011-03-28 20:34:01
|
Author: sewardj
Date: 2011-03-28 21:33:52 +0100 (Mon, 28 Mar 2011)
New Revision: 11674
Log:
Remove a bunch more warnings generated by gcc-4.6 about dead
assignments ("[-Wunused-but-set-variable]"), on ppc32-linux and
ppc64-linux.
Modified:
trunk/coregrind/m_debuginfo/debuginfo.c
trunk/coregrind/m_debuginfo/readdwarf.c
trunk/coregrind/m_debuginfo/readelf.c
trunk/coregrind/m_initimg/initimg-linux.c
trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c
trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c 2011-03-28 16:26:42 UTC (rev 11673)
+++ trunk/coregrind/m_debuginfo/debuginfo.c 2011-03-28 20:33:52 UTC (rev 11674)
@@ -2277,7 +2277,7 @@
{
CFSICacheEnt* ce;
DebugInfo* di;
- DiCfSI* cfsi;
+ DiCfSI* cfsi __attribute__((unused));
ce = cfsi_cache__find(ip);
@@ -2326,12 +2326,11 @@
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 @@
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; \
Modified: trunk/coregrind/m_debuginfo/readdwarf.c
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf.c 2011-03-28 16:26:42 UTC (rev 11673)
+++ trunk/coregrind/m_debuginfo/readdwarf.c 2011-03-28 20:33:52 UTC (rev 11674)
@@ -2384,7 +2384,7 @@
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 @@
/* 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 @@
# endif
/* else we must fail - can't represent the reg */
return -1;
+ }
default:
VG_(core_panic)("copy_convert_CfiExpr_tree: default");
}
Modified: trunk/coregrind/m_debuginfo/readelf.c
===================================================================
--- trunk/coregrind/m_debuginfo/readelf.c 2011-03-28 16:26:42 UTC (rev 11673)
+++ trunk/coregrind/m_debuginfo/readelf.c 2011-03-28 20:33:52 UTC (rev 11674)
@@ -1985,10 +1985,10 @@
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 @@
&& 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;
}
Modified: trunk/coregrind/m_initimg/initimg-linux.c
===================================================================
--- trunk/coregrind/m_initimg/initimg-linux.c 2011-03-28 16:26:42 UTC (rev 11673)
+++ trunk/coregrind/m_initimg/initimg-linux.c 2011-03-28 20:33:52 UTC (rev 11674)
@@ -620,7 +620,6 @@
# endif
for (; orig_auxv->a_type != AT_NULL; auxv++, orig_auxv++) {
- const NSegment *ehdrseg;
/* copy the entry... */
*auxv = *orig_auxv;
@@ -725,13 +724,14 @@
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:
Modified: trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c
===================================================================
--- trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c 2011-03-28 16:26:42 UTC (rev 11673)
+++ trunk/coregrind/m_sigframe/sigframe-ppc64-linux.c 2011-03-28 20:33:52 UTC (rev 11674)
@@ -189,7 +189,7 @@
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 @@
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,
Modified: trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2011-03-28 16:26:42 UTC (rev 11673)
+++ trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2011-03-28 20:33:52 UTC (rev 11674)
@@ -1061,7 +1061,7 @@
/* 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 @@
///* 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 @@
/* 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 @@
///* 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.
Modified: trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c 2011-03-28 16:26:42 UTC (rev 11673)
+++ trunk/coregrind/m_syswrap/syswrap-ppc64-linux.c 2011-03-28 20:33:52 UTC (rev 11674)
@@ -1046,7 +1046,7 @@
/* 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 @@
///* 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.
|