This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] add comment to sparseset.h about uninitialized data
- From: Peter Bergner <bergner at vnet dot ibm dot com>
- To: janis187 at us dot ibm dot com
- Cc: gcc-patches at gcc dot gnu dot org, Kenneth Zadeck <zadeck at naturalbridge dot com>
- Date: Tue, 30 Oct 2007 20:22:07 -0500
- Subject: Re: [PATCH] add comment to sparseset.h about uninitialized data
- References: <1193785776.9717.20.camel@janis-laptop> <1193791703.7128.151.camel@otta>
On Tue, 2007-10-30 at 19:48 -0500, Peter Bergner wrote:
> On Tue, 2007-10-30 at 16:09 -0700, Janis Johnson wrote:
> > For mainline cc1 with the testcase in PR33635 with -O1, valgrind reports
> > use of uninitialized values for sparse sets. The same problem was
> > reported in PR33796, in which Peter Bergner explained why the use of
> > uninitialized data is not a problem. This patch adds a comment so that
> > future users of valgrind won't file further bug reports or patches for
> > this particular issue. OK for mainline?
> Talking with Kenny offline, he seems to prefer adding a memset in
> sparseset_alloc() which would take care of the issue too. As I mention
> in the bugzilla, the memset is not required for correctness, but I am
> willing to do whatever people feel is best.
Actually, I now see your previous patch that uses xcalloc:
Which ever solution people prefer, we should go with one of your
patches. If the consensus is that we use xcalloc, then I'd like
a comment added mentioning that the only reason we're using xcalloc
rather than xmalloc is to shutup valgrind. That way, if the xcalloc
ends up being a performance problem, we know we can safely remove it.
Note that even though I wrote sparseset.[hc] and the only use of
it is within the register allocator, I'm not sure whether I can
approve either patch...although, I guess the comment patch can
be considered obvious.