|
From: Tim N. <nui...@gh...> - 2007-07-31 23:41:40
|
Our compiler occasionally generates the following sequence to write zero to memory: movl -0x44(%ebp), %edi xorl %edi, -0x44(%ebp) If -0x44(%ebp) wasn't initialized before, and is used afterwards, valgrind will flag that as a use of uninitialized data. If anybody has a work-around, or an easy modification to valgrind, I'm be all ears. (I'm checking to see if our compiler can be convinced to use a different sequence.) Tim -- Tim Newsome, Green Hills Probe Code Monkey at GHS; out 8/6--8/10, 8/14--8/21 nui...@gh..., 805-965-6044 ext. 235, http://www.ghs.com/ |
|
From: Nicholas N. <nj...@cs...> - 2007-08-01 01:14:12
|
On Tue, 31 Jul 2007, Tim Newsome wrote: > Our compiler occasionally generates the following sequence to write zero to > memory: > movl -0x44(%ebp), %edi > xorl %edi, -0x44(%ebp) > > If -0x44(%ebp) wasn't initialized before, and is used afterwards, valgrind > will flag that as a use of uninitialized data. If anybody has a work-around, > or an easy modification to valgrind, I'm be all ears. (I'm checking to see if > our compiler can be convinced to use a different sequence.) Memcheck handles the "xorl %r, %r" case correctly (ie. it knows it results in %r becoming zero), but it can't handle this case. I don't know of an easy workaround. We haven't heard of any compiler using this sequence before. Nick |