summaryrefslogtreecommitdiff
path: root/gcc/combine-stack-adj.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/combine-stack-adj.c')
-rw-r--r--gcc/combine-stack-adj.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/gcc/combine-stack-adj.c b/gcc/combine-stack-adj.c
index 69fd5ea77e3..399beb4c1bf 100644
--- a/gcc/combine-stack-adj.c
+++ b/gcc/combine-stack-adj.c
@@ -619,21 +619,6 @@ combine_stack_adjustments_for_block (basic_block bb)
free_csa_reflist (reflist);
}
-
-static bool
-gate_handle_stack_adjustments (void)
-{
- /* This is kind of a heuristic. We need to run combine_stack_adjustments
- even for machines with possibly nonzero TARGET_RETURN_POPS_ARGS
- and ACCUMULATE_OUTGOING_ARGS. We expect that only ports having
- push instructions will have popping returns. */
-#ifndef PUSH_ROUNDING
- if (ACCUMULATE_OUTGOING_ARGS)
- return false;
-#endif
- return flag_combine_stack_adjustments;
-}
-
static unsigned int
rest_of_handle_stack_adjustments (void)
{
@@ -650,7 +635,6 @@ const pass_data pass_data_stack_adjustments =
RTL_PASS, /* type */
"csa", /* name */
OPTGROUP_NONE, /* optinfo_flags */
- true, /* has_gate */
true, /* has_execute */
TV_COMBINE_STACK_ADJUST, /* tv_id */
0, /* properties_required */
@@ -668,11 +652,28 @@ public:
{}
/* opt_pass methods: */
- bool gate () { return gate_handle_stack_adjustments (); }
- unsigned int execute () { return rest_of_handle_stack_adjustments (); }
+ virtual bool gate (function *);
+ virtual unsigned int execute (function *)
+ {
+ return rest_of_handle_stack_adjustments ();
+ }
}; // class pass_stack_adjustments
+bool
+pass_stack_adjustments::gate (function *)
+{
+ /* This is kind of a heuristic. We need to run combine_stack_adjustments
+ even for machines with possibly nonzero TARGET_RETURN_POPS_ARGS
+ and ACCUMULATE_OUTGOING_ARGS. We expect that only ports having
+ push instructions will have popping returns. */
+#ifndef PUSH_ROUNDING
+ if (ACCUMULATE_OUTGOING_ARGS)
+ return false;
+#endif
+ return flag_combine_stack_adjustments;
+}
+
} // anon namespace
rtl_opt_pass *