+2016-04-17 Tom de Vries <tom@codesourcery.com>
+
+ PR other/68875
+ * pass_manager.h (TERMINATE_PASS_LIST): Add pass argument.
+ * passes.c (pass_manager::pass_manager): Declare and init p_start in
+ INSERT_PASSES_AFTER. Add pass parameter to TERMINATE_PASS_LIST, and
+ check if it's equal to p_start.
+ * passes.def: Add arguments to TERMINATE_PASS_LISTs.
+
2016-04-15 Jan Hubicka <jh@suse.cz>
PR ipa/70018
#define POP_INSERT_PASSES()
#define NEXT_PASS(PASS, NUM) opt_pass *PASS ## _ ## NUM
#define NEXT_PASS_WITH_ARG(PASS, NUM, ARG) NEXT_PASS (PASS, NUM)
-#define TERMINATE_PASS_LIST()
+#define TERMINATE_PASS_LIST(PASS)
#include "pass-instances.def"
/* Build the tree of passes. */
-#define INSERT_PASSES_AFTER(PASS) \
- p = &(PASS);
+#define INSERT_PASSES_AFTER(PASS) \
+ { \
+ opt_pass **p_start; \
+ p_start = p = &(PASS);
+
+#define TERMINATE_PASS_LIST(PASS) \
+ gcc_assert (p_start == &PASS); \
+ *p = NULL; \
+ }
#define PUSH_INSERT_PASSES_WITHIN(PASS) \
{ \
PASS ## _ ## NUM->set_pass_param (0, ARG); \
} while (0)
-#define TERMINATE_PASS_LIST() \
- *p = NULL;
-
#include "pass-instances.def"
#undef INSERT_PASSES_AFTER
PUSH_INSERT_PASSES_WITHIN (PASS)
POP_INSERT_PASSES ()
NEXT_PASS (PASS)
- TERMINATE_PASS_LIST ()
+ TERMINATE_PASS_LIST (PASS)
*/
/* All passes needed to lower the function into shape optimizers can
NEXT_PASS (pass_warn_function_return);
NEXT_PASS (pass_expand_omp);
NEXT_PASS (pass_build_cgraph_edges);
- TERMINATE_PASS_LIST ()
+ TERMINATE_PASS_LIST (all_lowering_passes)
/* Interprocedural optimization passes. */
INSERT_PASSES_AFTER (all_small_ipa_passes)
NEXT_PASS (pass_ipa_increase_alignment);
NEXT_PASS (pass_ipa_tm);
NEXT_PASS (pass_ipa_lower_emutls);
- TERMINATE_PASS_LIST ()
+ TERMINATE_PASS_LIST (all_small_ipa_passes)
INSERT_PASSES_AFTER (all_regular_ipa_passes)
NEXT_PASS (pass_ipa_whole_program_visibility);
symbols are not allowed outside of the comdat group. Privatizing early
would result in missed optimizations due to this restriction. */
NEXT_PASS (pass_ipa_comdats);
- TERMINATE_PASS_LIST ()
+ TERMINATE_PASS_LIST (all_regular_ipa_passes)
/* Simple IPA passes executed after the regular passes. In WHOPR mode the
passes are executed after partitioning and thus see just parts of the
NEXT_PASS (pass_ipa_pta);
NEXT_PASS (pass_dispatcher_calls);
NEXT_PASS (pass_omp_simd_clone);
- TERMINATE_PASS_LIST ()
+ TERMINATE_PASS_LIST (all_late_ipa_passes)
/* These passes are run after IPA passes on every function that is being
output to the assembler file. */
NEXT_PASS (pass_df_finish);
POP_INSERT_PASSES ()
NEXT_PASS (pass_clean_state);
- TERMINATE_PASS_LIST ()
+ TERMINATE_PASS_LIST (all_passes)