This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] add comment to sparseset.h about uninitialized data


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:

  http://gcc.gnu.org/ml/gcc-patches/2007-10/msg01847.html

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.

Peter




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]