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]

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


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)
 {



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