summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-22 12:56:47 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-22 12:56:47 +0000
commit030087e31b1253fb9ed6835a82e93a61ccc02493 (patch)
treee2bc6c7177a42d1b832555b60d0a854bcb834bd0 /gcc/tree-ssa-ccp.c
parentb4f314ea97f04620d290f3ae25d831f46692864f (diff)
parentac875fa40bf5429aff0612943d8c5705c4e11bb5 (diff)
downloadgcc-030087e31b1253fb9ed6835a82e93a61ccc02493.tar.gz
Merge from trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@209623 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c80
1 files changed, 35 insertions, 45 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index e5256683559..1fcbe09bb92 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -2324,13 +2324,6 @@ do_ssa_ccp (void)
}
-static bool
-gate_ccp (void)
-{
- return flag_tree_ccp != 0;
-}
-
-
namespace {
const pass_data pass_data_ccp =
@@ -2338,7 +2331,6 @@ const pass_data pass_data_ccp =
GIMPLE_PASS, /* type */
"ccp", /* name */
OPTGROUP_NONE, /* optinfo_flags */
- true, /* has_gate */
true, /* has_execute */
TV_TREE_CCP, /* tv_id */
( PROP_cfg | PROP_ssa ), /* properties_required */
@@ -2358,8 +2350,8 @@ public:
/* opt_pass methods: */
opt_pass * clone () { return new pass_ccp (m_ctxt); }
- bool gate () { return gate_ccp (); }
- unsigned int execute () { return do_ssa_ccp (); }
+ virtual bool gate (function *) { return flag_tree_ccp != 0; }
+ virtual unsigned int execute (function *) { return do_ssa_ccp (); }
}; // class pass_ccp
@@ -2604,14 +2596,43 @@ optimize_unreachable (gimple_stmt_iterator i)
/* A simple pass that attempts to fold all builtin functions. This pass
is run after we've propagated as many constants as we can. */
-static unsigned int
-execute_fold_all_builtins (void)
+namespace {
+
+const pass_data pass_data_fold_builtins =
+{
+ GIMPLE_PASS, /* type */
+ "fab", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_execute */
+ TV_NONE, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ ( TODO_verify_ssa | TODO_update_ssa ), /* todo_flags_finish */
+};
+
+class pass_fold_builtins : public gimple_opt_pass
+{
+public:
+ pass_fold_builtins (gcc::context *ctxt)
+ : gimple_opt_pass (pass_data_fold_builtins, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ opt_pass * clone () { return new pass_fold_builtins (m_ctxt); }
+ virtual unsigned int execute (function *);
+
+}; // class pass_fold_builtins
+
+unsigned int
+pass_fold_builtins::execute (function *fun)
{
bool cfg_changed = false;
basic_block bb;
unsigned int todoflags = 0;
- FOR_EACH_BB_FN (bb, cfun)
+ FOR_EACH_BB_FN (bb, fun)
{
gimple_stmt_iterator i;
for (i = gsi_start_bb (bb); !gsi_end_p (i); )
@@ -2653,7 +2674,7 @@ execute_fold_all_builtins (void)
result = gimple_fold_builtin (stmt);
if (result)
- gimple_remove_stmt_histograms (cfun, stmt);
+ gimple_remove_stmt_histograms (fun, stmt);
if (!result)
switch (DECL_FUNCTION_CODE (callee))
@@ -2748,37 +2769,6 @@ execute_fold_all_builtins (void)
return todoflags;
}
-
-namespace {
-
-const pass_data pass_data_fold_builtins =
-{
- GIMPLE_PASS, /* type */
- "fab", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- false, /* has_gate */
- true, /* has_execute */
- TV_NONE, /* tv_id */
- ( PROP_cfg | PROP_ssa ), /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- ( TODO_verify_ssa | TODO_update_ssa ), /* todo_flags_finish */
-};
-
-class pass_fold_builtins : public gimple_opt_pass
-{
-public:
- pass_fold_builtins (gcc::context *ctxt)
- : gimple_opt_pass (pass_data_fold_builtins, ctxt)
- {}
-
- /* opt_pass methods: */
- opt_pass * clone () { return new pass_fold_builtins (m_ctxt); }
- unsigned int execute () { return execute_fold_all_builtins (); }
-
-}; // class pass_fold_builtins
-
} // anon namespace
gimple_opt_pass *