diff options
author | aldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-12-05 17:26:05 +0000 |
---|---|---|
committer | aldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-12-05 17:26:05 +0000 |
commit | 35cc02b5c80ac6738c1a3362a822e3d7e4d0c587 (patch) | |
tree | 32d3ee1ddfcad180d619d756a84eeb0df779a6a2 /gcc/tree-ssa-propagate.c | |
parent | fc297ba47e780c3659434d04f3c299b705154d5f (diff) | |
download | gcc-35cc02b5c80ac6738c1a3362a822e3d7e4d0c587.tar.gz |
Merge gimple-tuples-branch into mainline.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119546 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-propagate.c')
-rw-r--r-- | gcc/tree-ssa-propagate.c | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c index a5114862dc8..b787aae70ba 100644 --- a/gcc/tree-ssa-propagate.c +++ b/gcc/tree-ssa-propagate.c @@ -531,12 +531,12 @@ get_rhs (tree stmt) { case RETURN_EXPR: stmt = TREE_OPERAND (stmt, 0); - if (!stmt || TREE_CODE (stmt) != MODIFY_EXPR) + if (!stmt || TREE_CODE (stmt) != GIMPLE_MODIFY_STMT) return stmt; /* FALLTHRU */ - case MODIFY_EXPR: - stmt = TREE_OPERAND (stmt, 1); + case GIMPLE_MODIFY_STMT: + stmt = GENERIC_TREE_OPERAND (stmt, 1); if (TREE_CODE (stmt) == WITH_SIZE_EXPR) return TREE_OPERAND (stmt, 0); else @@ -641,7 +641,8 @@ set_rhs (tree *stmt_p, tree expr) } if (EXPR_HAS_LOCATION (stmt) - && EXPR_P (expr) + && (EXPR_P (expr) + || GIMPLE_STMT_P (expr)) && ! EXPR_HAS_LOCATION (expr) && TREE_SIDE_EFFECTS (expr) && TREE_CODE (expr) != LABEL_EXPR) @@ -651,19 +652,23 @@ set_rhs (tree *stmt_p, tree expr) { case RETURN_EXPR: op = TREE_OPERAND (stmt, 0); - if (TREE_CODE (op) != MODIFY_EXPR) + if (TREE_CODE (op) != GIMPLE_MODIFY_STMT) { - TREE_OPERAND (stmt, 0) = expr; + GIMPLE_STMT_OPERAND (stmt, 0) = expr; break; } stmt = op; /* FALLTHRU */ - case MODIFY_EXPR: - op = TREE_OPERAND (stmt, 1); + case GIMPLE_MODIFY_STMT: + op = GIMPLE_STMT_OPERAND (stmt, 1); if (TREE_CODE (op) == WITH_SIZE_EXPR) - stmt = op; - TREE_OPERAND (stmt, 1) = expr; + { + stmt = op; + TREE_OPERAND (stmt, 1) = expr; + } + else + GIMPLE_STMT_OPERAND (stmt, 1) = expr; break; case COND_EXPR: @@ -686,7 +691,7 @@ set_rhs (tree *stmt_p, tree expr) effects, then replace *STMT_P with an empty statement. */ ann = stmt_ann (stmt); *stmt_p = TREE_SIDE_EFFECTS (expr) ? expr : build_empty_stmt (); - (*stmt_p)->common.ann = (tree_ann_t) ann; + (*stmt_p)->base.ann = (tree_ann_t) ann; if (gimple_in_ssa_p (cfun) && TREE_SIDE_EFFECTS (expr)) @@ -770,13 +775,13 @@ stmt_makes_single_load (tree stmt) { tree rhs; - if (TREE_CODE (stmt) != MODIFY_EXPR) + if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT) return false; if (ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF|SSA_OP_VUSE)) return false; - rhs = TREE_OPERAND (stmt, 1); + rhs = GIMPLE_STMT_OPERAND (stmt, 1); STRIP_NOPS (rhs); return (!TREE_THIS_VOLATILE (rhs) @@ -795,13 +800,13 @@ stmt_makes_single_store (tree stmt) { tree lhs; - if (TREE_CODE (stmt) != MODIFY_EXPR) + if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT) return false; if (ZERO_SSA_OPERANDS (stmt, SSA_OP_VMAYDEF|SSA_OP_VMUSTDEF)) return false; - lhs = TREE_OPERAND (stmt, 0); + lhs = GIMPLE_STMT_OPERAND (stmt, 0); STRIP_NOPS (lhs); return (!TREE_THIS_VOLATILE (lhs) @@ -963,7 +968,7 @@ replace_vuses_in (tree stmt, bool *replaced_addresses_p, see if we are trying to propagate a constant or a GIMPLE register (case #1 above). */ prop_value_t *val = get_value_loaded_by (stmt, prop_value); - tree rhs = TREE_OPERAND (stmt, 1); + tree rhs = GIMPLE_STMT_OPERAND (stmt, 1); if (val && val->value @@ -975,7 +980,7 @@ replace_vuses_in (tree stmt, bool *replaced_addresses_p, /* If we are replacing a constant address, inform our caller. */ if (TREE_CODE (val->value) != SSA_NAME - && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (stmt, 1))) + && POINTER_TYPE_P (TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 1))) && replaced_addresses_p) *replaced_addresses_p = true; @@ -985,7 +990,7 @@ replace_vuses_in (tree stmt, bool *replaced_addresses_p, stores between DEF_STMT and STMT, we only need to check that the RHS of STMT is the same as the memory reference propagated together with the value. */ - TREE_OPERAND (stmt, 1) = val->value; + GIMPLE_STMT_OPERAND (stmt, 1) = val->value; if (TREE_CODE (val->value) != SSA_NAME) prop_stats.num_const_prop++; @@ -1084,14 +1089,14 @@ static bool fold_predicate_in (tree stmt) { tree *pred_p = NULL; - bool modify_expr_p = false; + bool modify_stmt_p = false; tree val; - if (TREE_CODE (stmt) == MODIFY_EXPR - && COMPARISON_CLASS_P (TREE_OPERAND (stmt, 1))) + if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT + && COMPARISON_CLASS_P (GIMPLE_STMT_OPERAND (stmt, 1))) { - modify_expr_p = true; - pred_p = &TREE_OPERAND (stmt, 1); + modify_stmt_p = true; + pred_p = &GIMPLE_STMT_OPERAND (stmt, 1); } else if (TREE_CODE (stmt) == COND_EXPR) pred_p = &COND_EXPR_COND (stmt); @@ -1101,7 +1106,7 @@ fold_predicate_in (tree stmt) val = vrp_evaluate_conditional (*pred_p, true); if (val) { - if (modify_expr_p) + if (modify_stmt_p) val = fold_convert (TREE_TYPE (*pred_p), val); if (dump_file) @@ -1167,8 +1172,8 @@ substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p) /* Ignore ASSERT_EXPRs. They are used by VRP to generate range information for names and they are discarded afterwards. */ - if (TREE_CODE (stmt) == MODIFY_EXPR - && TREE_CODE (TREE_OPERAND (stmt, 1)) == ASSERT_EXPR) + if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT + && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == ASSERT_EXPR) continue; /* Replace the statement with its folded version and mark it |