diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-04 10:21:07 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-04 10:21:07 +0000 |
commit | c2acfe907a298bac322cb4e249470f16c9d2a24b (patch) | |
tree | acb1b826af7559a70b5c2f6988aadf6a62d1db93 /gcc/gimplify.c | |
parent | 8608a07f33f3d77eedb8d1276cb27ff4e18e0293 (diff) | |
download | gcc-c2acfe907a298bac322cb4e249470f16c9d2a24b.tar.gz |
2010-09-04 Richard Guenther <rguenther@suse.de>
PR bootstrap/45519
* tree-flow.h (force_gimple_operand_1): Declare.
(force_gimple_operand_gsi_1): Likewise.
* gimplify.c (force_gimple_operand_1): New worker taking a
gimple predicate for ...
(force_gimple_operand): ... which now wraps it.
(force_gimple_operand_gsi_1, force_gimple_operand_gsi): Likewise.
* tree-ssa-loop-ivopts.c (find_interesting_uses_address): Revert
last change.
* tree-ssa-address.c (gimplify_mem_ref_parts): Use
force_gimple_operand_gsi_1 with is_gimple_mem_ref_addr.
(create_mem_ref): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163858 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 63 |
1 files changed, 47 insertions, 16 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 1723f42d8a2..be9e22d650c 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -8008,17 +8008,16 @@ gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p) } -/* Expands EXPR to list of gimple statements STMTS. If SIMPLE is true, - force the result to be either ssa_name or an invariant, otherwise - just force it to be a rhs expression. If VAR is not NULL, make the +/* Expands EXPR to list of gimple statements STMTS. GIMPLE_TEST_F specifies + the predicate that will hold for the result. If VAR is not NULL, make the base variable of the final destination be VAR if suitable. */ tree -force_gimple_operand (tree expr, gimple_seq *stmts, bool simple, tree var) +force_gimple_operand_1 (tree expr, gimple_seq *stmts, + gimple_predicate gimple_test_f, tree var) { tree t; enum gimplify_status ret; - gimple_predicate gimple_test_f; struct gimplify_ctx gctx; *stmts = NULL; @@ -8026,8 +8025,6 @@ force_gimple_operand (tree expr, gimple_seq *stmts, bool simple, tree var) if (is_gimple_val (expr)) return expr; - gimple_test_f = simple ? is_gimple_val : is_gimple_reg_rhs; - push_gimplify_context (&gctx); gimplify_ctxp->into_ssa = gimple_in_ssa_p (cfun); gimplify_ctxp->allow_rhs_cond_expr = true; @@ -8056,20 +8053,34 @@ force_gimple_operand (tree expr, gimple_seq *stmts, bool simple, tree var) return expr; } -/* Invokes force_gimple_operand for EXPR with parameters SIMPLE_P and VAR. If - some statements are produced, emits them at GSI. If BEFORE is true. - the statements are appended before GSI, otherwise they are appended after - it. M specifies the way GSI moves after insertion (GSI_SAME_STMT or - GSI_CONTINUE_LINKING are the usual values). */ +/* Expands EXPR to list of gimple statements STMTS. If SIMPLE is true, + force the result to be either ssa_name or an invariant, otherwise + just force it to be a rhs expression. If VAR is not NULL, make the + base variable of the final destination be VAR if suitable. */ tree -force_gimple_operand_gsi (gimple_stmt_iterator *gsi, tree expr, - bool simple_p, tree var, bool before, - enum gsi_iterator_update m) +force_gimple_operand (tree expr, gimple_seq *stmts, bool simple, tree var) +{ + return force_gimple_operand_1 (expr, stmts, + simple ? is_gimple_val : is_gimple_reg_rhs, + var); +} + +/* Invokes force_gimple_operand_1 for EXPR with parameters GIMPLE_TEST_F + and VAR. If some statements are produced, emits them at GSI. + If BEFORE is true. the statements are appended before GSI, otherwise + they are appended after it. M specifies the way GSI moves after + insertion (GSI_SAME_STMT or GSI_CONTINUE_LINKING are the usual values). */ + +tree +force_gimple_operand_gsi_1 (gimple_stmt_iterator *gsi, tree expr, + gimple_predicate gimple_test_f, + tree var, bool before, + enum gsi_iterator_update m) { gimple_seq stmts; - expr = force_gimple_operand (expr, &stmts, simple_p, var); + expr = force_gimple_operand_1 (expr, &stmts, gimple_test_f, var); if (!gimple_seq_empty_p (stmts)) { @@ -8090,4 +8101,24 @@ force_gimple_operand_gsi (gimple_stmt_iterator *gsi, tree expr, return expr; } +/* Invokes force_gimple_operand_1 for EXPR with parameter VAR. + If SIMPLE is true, force the result to be either ssa_name or an invariant, + otherwise just force it to be a rhs expression. If some statements are + produced, emits them at GSI. If BEFORE is true, the statements are + appended before GSI, otherwise they are appended after it. M specifies + the way GSI moves after insertion (GSI_SAME_STMT or GSI_CONTINUE_LINKING + are the usual values). */ + +tree +force_gimple_operand_gsi (gimple_stmt_iterator *gsi, tree expr, + bool simple_p, tree var, bool before, + enum gsi_iterator_update m) +{ + return force_gimple_operand_gsi_1 (gsi, expr, + simple_p + ? is_gimple_val : is_gimple_reg_rhs, + var, before, m); +} + + #include "gt-gimplify.h" |