aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2016-04-17 05:21:50 +0000
committerTom de Vries <vries@gcc.gnu.org>2016-04-17 05:21:50 +0000
commit17e7ab87992bddfeb3a5f051e024e94d97cbc0a8 (patch)
treefeed22d61c5fac4a518aa2fd15530570673c839f
parent767f8bb1b1a1cacaff3d0c9432101eb963643e57 (diff)
downloadgcc-17e7ab87992bddfeb3a5f051e024e94d97cbc0a8.zip
gcc-17e7ab87992bddfeb3a5f051e024e94d97cbc0a8.tar.gz
gcc-17e7ab87992bddfeb3a5f051e024e94d97cbc0a8.tar.bz2
Add pass parameter to TERMINATE_PASS_LIST
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. From-SVN: r235071
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/pass_manager.h2
-rw-r--r--gcc/passes.c14
-rw-r--r--gcc/passes.def12
4 files changed, 25 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c738ef3..91807e6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+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
diff --git a/gcc/pass_manager.h b/gcc/pass_manager.h
index 6b602a2..4f89d31 100644
--- a/gcc/pass_manager.h
+++ b/gcc/pass_manager.h
@@ -121,7 +121,7 @@ private:
#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"
diff --git a/gcc/passes.c b/gcc/passes.c
index e896181..7b6deee 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -1555,8 +1555,15 @@ pass_manager::pass_manager (context *ctxt)
/* 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) \
{ \
@@ -1584,9 +1591,6 @@ pass_manager::pass_manager (context *ctxt)
PASS ## _ ## NUM->set_pass_param (0, ARG); \
} while (0)
-#define TERMINATE_PASS_LIST() \
- *p = NULL;
-
#include "pass-instances.def"
#undef INSERT_PASSES_AFTER
diff --git a/gcc/passes.def b/gcc/passes.def
index 7aed144..834fea2 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
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
@@ -43,7 +43,7 @@ along with GCC; see the file COPYING3. If not see
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)
@@ -142,7 +142,7 @@ along with GCC; see the file COPYING3. If not see
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);
@@ -162,7 +162,7 @@ along with GCC; see the file COPYING3. If not see
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
@@ -171,7 +171,7 @@ along with GCC; see the file COPYING3. If not see
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. */
@@ -487,4 +487,4 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_df_finish);
POP_INSERT_PASSES ()
NEXT_PASS (pass_clean_state);
- TERMINATE_PASS_LIST ()
+ TERMINATE_PASS_LIST (all_passes)