summaryrefslogtreecommitdiff
path: root/gcc/tree-switch-conversion.c
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-16 22:29:52 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-16 22:29:52 +0000
commit389dd41bd043170e7dc7660304f14a5f16af3562 (patch)
treee4de0ffc0a0ca77f35b03bf9e8a248a4b5735f6a /gcc/tree-switch-conversion.c
parentc1c67b4f5041c4367842002c81ffe912ff97f2d8 (diff)
downloadgcc-389dd41bd043170e7dc7660304f14a5f16af3562.tar.gz
2009-07-17 Aldy Hernandez <aldyh@redhat.com>
Manuel López-Ibáñez <manu@gcc.gnu.org> PR 40435 * tree-complex.c, tree-loop-distribution.c, tree.c, tree.h, builtins.c, fold-const.c, omp-low.c, cgraphunit.c, tree-ssa-ccp.c, tree-ssa-dom.c, gimple-low.c, expr.c, tree-ssa-ifcombine.c, c-decl.c, stor-layout.c, tree-if-conv.c, c-typeck.c, gimplify.c, calls.c, tree-sra.c, tree-mudflap.c, tree-ssa-copy.c, tree-ssa-forwprop.c, c-convert.c, c-omp.c, varasm.c, tree-inline.c, c-common.c, c-common.h, gimple.c, tree-switch-conversion.c, gimple.h, tree-cfg.c, c-parser.c, convert.c: Add location argument to fold_{unary,binary,ternary}, fold_build[123], build_call_expr, build_size_arg, build_fold_addr_expr, build_call_array, non_lvalue, size_diffop, fold_build1_initializer, fold_build2_initializer, fold_build3_initializer, fold_build_call_array, fold_build_call_array_initializer, fold_single_bit_test, omit_one_operand, omit_two_operands, invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref, combine_comparisons, fold_builtin_*, fold_call_expr, build_range_check, maybe_fold_offset_to_address, round_up, round_down. objc/ * objc-act.c: Add location argument to all calls to build_fold_addr_expr. testsuite/ * gcc.dg/pr36902.c: Add column info. * g++.dg/gcov/gcov-2.C: Change count for definition. cp/ * typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c, tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c, call.c, cvt.c, mangle.c: Add location argument to fold_{unary,binary,ternary}, fold_build[123], build_call_expr, build_size_arg, build_fold_addr_expr, build_call_array, non_lvalue, size_diffop, fold_build1_initializer, fold_build2_initializer, fold_build3_initializer, fold_build_call_array, fold_build_call_array_initializer, fold_single_bit_test, omit_one_operand, omit_two_operands, invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref, combine_comparisons, fold_builtin_*, fold_call_expr, build_range_check, maybe_fold_offset_to_address, round_up, round_down. fortran/ * trans-expr.c, trans-array.c, trans-openmp.c, trans-stmt.c, trans.c, trans-io.c, trans-decl.c, trans-intrinsic.c: Add location argument to fold_{unary,binary,ternary}, fold_build[123], build_call_expr, build_size_arg, build_fold_addr_expr, build_call_array, non_lvalue, size_diffop, fold_build1_initializer, fold_build2_initializer, fold_build3_initializer, fold_build_call_array, fold_build_call_array_initializer, fold_single_bit_test, omit_one_operand, omit_two_operands, invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref, combine_comparisons, fold_builtin_*, fold_call_expr, build_range_check, maybe_fold_offset_to_address, round_up, round_down. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149722 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);