summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-07-04 09:57:59 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-07-04 09:57:59 +0000
commit49a931ef977ecf06da7b7228c51856d725b26baf (patch)
tree4ffd4c1af2fb0548152602ff365dcc65441c31a3
parentfc733d7acdfa8558f385da0510f03abde53c8565 (diff)
downloadgcc-49a931ef977ecf06da7b7228c51856d725b26baf.tar.gz
* tree-switch-conversion.c (build_one_array, gen_def_assigns): Use
build_gimple_modify_stmt. (build_arrays, gen_inbound_check): Likewise. Force RHS to be gimple operand. Use fold_build* instead of build*. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137454 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree-switch-conversion.c27
2 files changed, 23 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9655811db9b..69053a95930 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2008-07-04 Jakub Jelinek <jakub@redhat.com>
+
+ * tree-switch-conversion.c (build_one_array, gen_def_assigns): Use
+ build_gimple_modify_stmt.
+ (build_arrays, gen_inbound_check): Likewise. Force RHS to be
+ gimple operand. Use fold_build* instead of build*.
+
2008-07-04 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (lookup_vi_for_tree): Declare.
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index 68d6b50d1bd..0ce5fc91ead 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -482,7 +482,7 @@ build_one_array (tree swtch, int num, tree arr_index_type, tree phi, tree tidx)
fetch = build4 (ARRAY_REF, value_type, decl, tidx, NULL_TREE,
NULL_TREE);
- load = build2 (GIMPLE_MODIFY_STMT, void_type_node, name, fetch);
+ load = build_gimple_modify_stmt (name, fetch);
SSA_NAME_DEF_STMT (name) = load;
bsi = bsi_for_stmt (swtch);
@@ -507,13 +507,17 @@ build_arrays (tree swtch)
tree phi = phi_nodes (info.final_bb);
int i;
+ bsi = bsi_for_stmt (swtch);
+
arr_index_type = build_index_type (info.range_size);
tidx = make_rename_temp (arr_index_type, "csti");
- sub = build2 (MINUS_EXPR, TREE_TYPE (info.index_expr), info.index_expr,
- fold_convert (TREE_TYPE (info.index_expr), info.range_min));
- sub = build2 (GIMPLE_MODIFY_STMT, void_type_node, tidx, sub);
+ sub = fold_build2 (MINUS_EXPR, TREE_TYPE (info.index_expr), info.index_expr,
+ fold_convert (TREE_TYPE (info.index_expr),
+ info.range_min));
+ sub = force_gimple_operand_bsi (&bsi, fold_convert (arr_index_type, sub),
+ false, NULL, true, BSI_SAME_STMT);
+ sub = build_gimple_modify_stmt (tidx, sub);
- bsi = bsi_for_stmt (swtch);
bsi_insert_before (&bsi, sub, BSI_SAME_STMT);
mark_symbols_for_renaming (sub);
info.arr_ref_first = sub;
@@ -539,8 +543,7 @@ gen_def_assigns (block_stmt_iterator *bsi)
NULL_TREE);
info.target_outbound_names[i] = name;
- assign = build2 (GIMPLE_MODIFY_STMT, void_type_node, name,
- info.default_values[i]);
+ assign = build_gimple_modify_stmt (name, info.default_values[i]);
SSA_NAME_DEF_STMT (name) = assign;
bsi_insert_before (bsi, assign, BSI_SAME_STMT);
find_new_referenced_vars (&assign);
@@ -639,15 +642,17 @@ gen_inbound_check (tree swtch)
bsi = bsi_for_stmt (info.arr_ref_first);
tmp_u = make_rename_temp (utype, "csui");
- cast = build1 (NOP_EXPR, utype, info.index_expr);
- cast_assign = build2 (GIMPLE_MODIFY_STMT, void_type_node, tmp_u, cast);
+ cast = fold_convert (utype, info.index_expr);
+ cast_assign = build_gimple_modify_stmt (tmp_u, cast);
find_new_referenced_vars (&cast_assign);
bsi_insert_before (&bsi, cast_assign, BSI_SAME_STMT);
mark_symbols_for_renaming (cast_assign);
ulb = fold_convert (utype, info.range_min);
- minus = build2 (MINUS_EXPR, utype, tmp_u, ulb);
- minus_assign = build2 (GIMPLE_MODIFY_STMT, void_type_node, tmp_u, minus);
+ minus = fold_build2 (MINUS_EXPR, utype, tmp_u, ulb);
+ minus = force_gimple_operand_bsi (&bsi, minus, false, NULL, true,
+ BSI_SAME_STMT);
+ minus_assign = build_gimple_modify_stmt (tmp_u, minus);
find_new_referenced_vars (&minus_assign);
bsi_insert_before (&bsi, minus_assign, BSI_SAME_STMT);
mark_symbols_for_renaming (minus_assign);