diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2004-11-08 15:02:14 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2004-11-08 15:02:14 +0000 |
commit | 1b7cd4a5e5d48b9026c110ba32560b7a9a3ad2d3 (patch) | |
tree | d9a810e5b0358753a2e2893459e0d52f997070ed /gcc/tree-if-conv.c | |
parent | f7b529fae761c8603888bee76614147954754e75 (diff) | |
download | gcc-1b7cd4a5e5d48b9026c110ba32560b7a9a3ad2d3.zip gcc-1b7cd4a5e5d48b9026c110ba32560b7a9a3ad2d3.tar.gz gcc-1b7cd4a5e5d48b9026c110ba32560b7a9a3ad2d3.tar.bz2 |
tree-if-conv.c (tree_if_convert_cond_expr): Remove two "if" statements that always trigger.
* tree-if-conv.c (tree_if_convert_cond_expr): Remove two "if"
statements that always trigger.
From-SVN: r90267
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r-- | gcc/tree-if-conv.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index 89592f0..371d0a6 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -271,7 +271,7 @@ static void tree_if_convert_cond_expr (struct loop *loop, tree stmt, tree cond, block_stmt_iterator *bsi) { - tree then_clause, else_clause, c, new_cond; + tree then_clause, else_clause, c, c2, new_cond; new_cond = NULL_TREE; gcc_assert (TREE_CODE (stmt) == COND_EXPR); @@ -290,27 +290,23 @@ tree_if_convert_cond_expr (struct loop *loop, tree stmt, tree cond, } /* Add new condition into destination's predicate list. */ - if (then_clause) - /* if 'c' is true then then_clause is reached. */ - new_cond = add_to_dst_predicate_list (loop, then_clause, cond, - unshare_expr (c), bsi); - if (else_clause) - { - tree c2; - if (!is_gimple_reg(c) && is_gimple_condexpr (c)) - { - tree new_stmt; - new_stmt = ifc_temp_var (TREE_TYPE (c), unshare_expr (c)); - bsi_insert_before (bsi, new_stmt, BSI_SAME_STMT); - c = TREE_OPERAND (new_stmt, 0); - } + /* If 'c' is true then then_clause is reached. */ + new_cond = add_to_dst_predicate_list (loop, then_clause, cond, + unshare_expr (c), bsi); - /* if 'c' is false then else_clause is reached. */ - c2 = invert_truthvalue (unshare_expr (c)); - add_to_dst_predicate_list (loop, else_clause, cond, c2, bsi); + if (!is_gimple_reg(c) && is_gimple_condexpr (c)) + { + tree new_stmt; + new_stmt = ifc_temp_var (TREE_TYPE (c), unshare_expr (c)); + bsi_insert_before (bsi, new_stmt, BSI_SAME_STMT); + c = TREE_OPERAND (new_stmt, 0); } + /* If 'c' is false then else_clause is reached. */ + c2 = invert_truthvalue (unshare_expr (c)); + add_to_dst_predicate_list (loop, else_clause, cond, c2, bsi); + /* Now this conditional statement is redundant. Remove it. But, do not remove exit condition! Update exit condition using new condition. */ |