summaryrefslogtreecommitdiff
path: root/gcc/tree-switch-conversion.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-20 05:35:17 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-20 05:35:17 +0000
commit6b351cc8c497c4ed9d296b55b424341f20b56f92 (patch)
tree8bcbc6cc30a2f9d6253007a662393cfed258713a /gcc/tree-switch-conversion.c
parentd0df232358778b869142e628e5e736fc7515f5ab (diff)
downloadgcc-6b351cc8c497c4ed9d296b55b424341f20b56f92.tar.gz
2009-07-20 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 149800 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@149801 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-switch-conversion.c')
-rw-r--r--gcc/tree-switch-conversion.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index 2e6808b7a4d..a5494827b37 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -552,6 +552,7 @@ build_arrays (gimple swtch)
gimple stmt;
gimple_stmt_iterator gsi;
int i;
+ location_t loc = gimple_location (swtch);
gsi = gsi_for_stmt (swtch);
@@ -559,9 +560,10 @@ build_arrays (gimple swtch)
tmp = create_tmp_var (TREE_TYPE (info.index_expr), "csti");
add_referenced_var (tmp);
tidx = make_ssa_name (tmp, NULL);
- sub = fold_build2 (MINUS_EXPR, TREE_TYPE (info.index_expr), info.index_expr,
- fold_convert (TREE_TYPE (info.index_expr),
- info.range_min));
+ sub = fold_build2_loc (loc, MINUS_EXPR,
+ TREE_TYPE (info.index_expr), info.index_expr,
+ fold_convert_loc (loc, TREE_TYPE (info.index_expr),
+ info.range_min));
sub = force_gimple_operand_gsi (&gsi, sub,
false, NULL, true, GSI_SAME_STMT);
stmt = gimple_build_assign (tidx, sub);
@@ -684,6 +686,7 @@ gen_inbound_check (gimple swtch)
gimple_stmt_iterator gsi;
basic_block bb0, bb1, bb2, bbf, bbd;
edge e01, e02, e21, e1d, e1f, e2f;
+ location_t loc = gimple_location (swtch);
gcc_assert (info.default_values);
bb0 = gimple_bb (swtch);
@@ -700,14 +703,14 @@ gen_inbound_check (gimple swtch)
add_referenced_var (tmp_u_var);
tmp_u_1 = make_ssa_name (tmp_u_var, NULL);
- cast = fold_convert (utype, info.index_expr);
+ cast = fold_convert_loc (loc, utype, info.index_expr);
cast_assign = gimple_build_assign (tmp_u_1, cast);
SSA_NAME_DEF_STMT (tmp_u_1) = cast_assign;
gsi_insert_before (&gsi, cast_assign, GSI_SAME_STMT);
update_stmt (cast_assign);
- ulb = fold_convert (utype, info.range_min);
- minus = fold_build2 (MINUS_EXPR, utype, tmp_u_1, ulb);
+ ulb = fold_convert_loc (loc, utype, info.range_min);
+ minus = fold_build2_loc (loc, MINUS_EXPR, utype, tmp_u_1, ulb);
minus = force_gimple_operand_gsi (&gsi, minus, false, NULL, true,
GSI_SAME_STMT);
tmp_u_2 = make_ssa_name (tmp_u_var, NULL);
@@ -716,7 +719,7 @@ gen_inbound_check (gimple swtch)
gsi_insert_before (&gsi, minus_assign, GSI_SAME_STMT);
update_stmt (minus_assign);
- bound = fold_convert (utype, info.range_size);
+ bound = fold_convert_loc (loc, utype, info.range_size);
cond_stmt = gimple_build_cond (LE_EXPR, tmp_u_2, bound, NULL_TREE, NULL_TREE);
gsi_insert_before (&gsi, cond_stmt, GSI_SAME_STMT);
update_stmt (cond_stmt);