|
From: Dirk M. <dm...@gm...> - 2003-11-21 04:30:04
|
On Thursday 20 November 2003 22:58, John Reiser wrote:
> Valgrind 2.0.0 (memcheck) does not notice when a conditional jump
> depends on an uninitialized bit.
Oh it does notice. It just suppresses the error due to this commit:
revision 1.10
date: 2002/10/13 00:57:26; author: sewardj; state: Exp; lines: +40 -1
Incorporate horrible hack to workaround problem of emitting bogus
uninit-value errors on code with inlined strlen() et al from gcc-3.1
and above.
A simplified testcase is:
--- Cut
int main()
{
unsigned x;
x &= 0x8080;
if (x & 0x8000)
printf("uninit caught %#x\n", &x);
return 0;
}
---- Cut
Problem is that we suppress the uninit bits testing in basic blocks which
contain the magic literal 0x8080 or 0x80808080.
If you run valgrind with --avoid-strlen-errors=no the error is shown.
Switching the default does not cause a regression test failure (!!). Julian,
do you still have the original snipped that made you add this kludge? Maybe
it was obsoleted by other improvements.
|