This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] add comment to sparseset.h about uninitialized data
- From: Janis Johnson <janis187 at us dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: bergner at vnet dot ibm dot com
- Date: Tue, 30 Oct 2007 16:09:35 -0700
- Subject: [PATCH] add comment to sparseset.h about uninitialized data
- Reply-to: janis187 at us dot ibm dot com
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?
2007-10-30 Janis Johnson <janis187@us.ibm.com>
* sparseset.h (sparseset_bit_p): Add comment that arrays might be
accessed unintialized.
Index: gcc/sparseset.h
===================================================================
--- gcc/sparseset.h (revision 129777)
+++ gcc/sparseset.h (working copy)
@@ -76,8 +76,11 @@
return s->size;
}
-/* Return true if e is a member of the set S, otherwise return false. */
+/* Return true if e is a member of the set S, otherwise return false.
+ The arrays s->sparse and s->dense are not, and do not need to be,
+ initialized. Reads of those arrays are harmless. */
+
static inline bool
sparseset_bit_p (sparseset s, SPARSESET_ELT_TYPE e)
{