@@ -1,3 +1,14 @@
+2014-03-10 David Malcolm <dmalcolm@redhat.com>
+
+ * ipa-reference.c (ipa_init): Move static bool init_p from here
+ to...
+ (ipa_init_p): New file-scope variable, so that it can be reset
+ when repeatedly invoking the compiler within one process by...
+ (ipa_reference_c_finalize): New function.
+ * ipa-reference.h (ipa_reference_c_finalize): New.
+ * toplev.c (toplev_finalize): Invoke new function
+ ipa_reference_c_finalize.
+
2014-01-24 David Malcolm <dmalcolm@redhat.com>
* timevar.def: Replace TV_CLIENT_CALLBACK with TV_JIT_REPLAY.
@@ -403,17 +403,17 @@ propagate_bits (ipa_reference_global_vars_info_t x_global, struct cgraph_node *x
}
}
+static bool ipa_init_p = false;
+
/* The init routine for analyzing global static variable usage. See
comments at top for description. */
static void
ipa_init (void)
{
- static bool init_p = false;
-
- if (init_p)
+ if (ipa_init_p)
return;
- init_p = true;
+ ipa_init_p = true;
if (dump_file)
reference_vars_to_consider = splay_tree_new (splay_tree_compare_ints, 0, 0);
@@ -1199,3 +1199,8 @@ make_pass_ipa_reference (gcc::context *ctxt)
{
return new pass_ipa_reference (ctxt);
}
+
+void ipa_reference_c_finalize (void)
+{
+ ipa_init_p = false;
+}
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
/* In ipa-reference.c */
bitmap ipa_reference_get_not_read_global (struct cgraph_node *fn);
bitmap ipa_reference_get_not_written_global (struct cgraph_node *fn);
+void ipa_reference_c_finalize (void);
#endif /* GCC_IPA_REFERENCE_H */
@@ -78,6 +78,7 @@ along with GCC; see the file COPYING3. If not see
#include "context.h"
#include "pass_manager.h"
#include "dwarf2out.h"
+#include "ipa-reference.h"
#if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO)
#include "dbxout.h"
@@ -2000,6 +2001,7 @@ void toplev_finalize (void)
cgraphunit_c_finalize ();
dwarf2out_c_finalize ();
ipa_c_finalize ();
+ ipa_reference_c_finalize ();
predict_c_finalize ();
symtab_c_finalize ();
varpool_c_finalize ();