From 49d7df3c645459a0f90179dfb1a24cef459b186e Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Wed, 31 Jul 2013 14:20:07 -0400
Subject: [PATCH 03.1/15] Explicitly initialize the macro-generated pass fields
to NULL
gcc/
* passes.c (pass_manager::pass_manager): Explicitly initialize
the macro-generated pass fields to NULL.
---
gcc/passes.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
@@ -1352,6 +1352,28 @@ pass_manager::pass_manager (context *ctxt)
GCC_PASS_LISTS
#undef DEF_PASS_LIST
+ /* For safety, NULL-initialize the various fields for individual pass
+ instances (mainly so that the:
+ gcc_assert (NULL == PASS ## _ ## NUM);
+ sees an initial NULL value).
+
+ We cannot use member initializers for this since pass-instances.def
+ contains semicolons. */
+
+#define INSERT_PASSES_AFTER(PASS)
+#define PUSH_INSERT_PASSES_WITHIN(PASS)
+#define POP_INSERT_PASSES()
+#define NEXT_PASS(PASS, NUM) PASS ## _ ## NUM = NULL;
+#define TERMINATE_PASS_LIST()
+
+#include "pass-instances.def"
+
+#undef INSERT_PASSES_AFTER
+#undef PUSH_INSERT_PASSES_WITHIN
+#undef POP_INSERT_PASSES
+#undef NEXT_PASS
+#undef TERMINATE_PASS_LIST
+
/* Build the tree of passes. */
#define INSERT_PASSES_AFTER(PASS) \
--
1.7.11.7