This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Document tree.h flags more, fixup valgrind alloc-pool.c
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 21 Aug 2012 12:48:00 +0200 (CEST)
- Subject: [PATCH] Document tree.h flags more, fixup valgrind alloc-pool.c
Testing in progress.
Richard.
2012-08-21 Richard Guenther <rguenther@suse.de>
* alloc-pool.c (pool_alloc): Fix valgrind annotation.
* tree.h: Complete flags documentation.
(CLEANUP_EH_ONLY): Check documented allowed tree codes.
Index: gcc/alloc-pool.c
===================================================================
--- gcc/alloc-pool.c (revision 190558)
+++ gcc/alloc-pool.c (working copy)
@@ -247,7 +247,9 @@ void *
pool_alloc (alloc_pool pool)
{
alloc_pool_list header;
- VALGRIND_DISCARD (int size);
+#ifdef ENABLE_VALGRIND_CHECKING
+ int size;
+#endif
if (GATHER_STATISTICS)
{
@@ -260,7 +262,9 @@ pool_alloc (alloc_pool pool)
}
gcc_checking_assert (pool);
- VALGRIND_DISCARD (size = pool->elt_size - offsetof (allocation_object, u.data));
+#ifdef ENABLE_VALGRIND_CHECKING
+ size = pool->elt_size - offsetof (allocation_object, u.data);
+#endif
/* If there are no more free elements, make some more!. */
if (!pool->returned_free_list)
Index: gcc/tree.h
===================================================================
--- gcc/tree.h (revision 190558)
+++ gcc/tree.h (working copy)
@@ -417,7 +417,7 @@ enum omp_clause_code
so all nodes have these fields.
See the accessor macros, defined below, for documentation of the
- fields, and the table below which connects the fileds and the
+ fields, and the table below which connects the fields and the
accessor macros. */
struct GTY(()) tree_base {
@@ -494,6 +494,9 @@ struct GTY(()) tree_base {
CASE_LOW_SEEN in
CASE_LABEL_EXPR
+ PREDICT_EXPR_OUTCOME in
+ PREDICT_EXPR
+
static_flag:
TREE_STATIC in
@@ -576,12 +579,16 @@ struct GTY(()) tree_base {
OMP_PARALLEL_COMBINED in
OMP_PARALLEL
+
OMP_CLAUSE_PRIVATE_OUTER_REF in
OMP_CLAUSE_PRIVATE
TYPE_REF_IS_RVALUE in
REFERENCE_TYPE
+ ENUM_IS_OPAQUE in
+ ENUMERAL_TYPE
+
protected_flag:
TREE_PROTECTED in
@@ -1117,7 +1124,8 @@ extern void omp_clause_range_check_faile
/* In a TARGET_EXPR or WITH_CLEANUP_EXPR, means that the pertinent cleanup
should only be executed if an exception is thrown, not on normal exit
of its scope. */
-#define CLEANUP_EH_ONLY(NODE) ((NODE)->base.static_flag)
+#define CLEANUP_EH_ONLY(NODE) \
+ (TREE_CHECK2 (NODE, TARGET_EXPR, WITH_CLEANUP_EXPR)->base.static_flag)
/* In a TRY_CATCH_EXPR, means that the handler should be considered a
separate cleanup in honor_protect_cleanup_actions. */