diff options
author | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-16 22:29:52 +0000 |
---|---|---|
committer | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-16 22:29:52 +0000 |
commit | 389dd41bd043170e7dc7660304f14a5f16af3562 (patch) | |
tree | e4de0ffc0a0ca77f35b03bf9e8a248a4b5735f6a /gcc/tree-mudflap.c | |
parent | c1c67b4f5041c4367842002c81ffe912ff97f2d8 (diff) | |
download | gcc-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-mudflap.c')
-rw-r--r-- | gcc/tree-mudflap.c | 52 |
1 files changed, 31 insertions, 21 deletions
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c index 8fcafca4b8f..381b029d45f 100644 --- a/gcc/tree-mudflap.c +++ b/gcc/tree-mudflap.c @@ -581,7 +581,8 @@ mf_build_check_statement_for (tree base, tree limit, /* Build: __mf_base = (uintptr_t) <base address expression>. */ seq = gimple_seq_alloc (); - t = fold_convert (mf_uintptr_type, unshare_expr (base)); + t = fold_convert_loc (location, mf_uintptr_type, + unshare_expr (base)); t = force_gimple_operand (t, &stmts, false, NULL_TREE); gimple_seq_add_seq (&seq, stmts); g = gimple_build_assign (mf_base, t); @@ -589,7 +590,8 @@ mf_build_check_statement_for (tree base, tree limit, gimple_seq_add_stmt (&seq, g); /* Build: __mf_limit = (uintptr_t) <limit address expression>. */ - t = fold_convert (mf_uintptr_type, unshare_expr (limit)); + t = fold_convert_loc (location, mf_uintptr_type, + unshare_expr (limit)); t = force_gimple_operand (t, &stmts, false, NULL_TREE); gimple_seq_add_seq (&seq, stmts); g = gimple_build_assign (mf_limit, t); @@ -693,8 +695,9 @@ mf_build_check_statement_for (tree base, tree limit, /* u is a string, so it is already a gimple value. */ u = mf_file_function_line_tree (location); /* NB: we pass the overall [base..limit] range to mf_check. */ - v = fold_build2 (PLUS_EXPR, mf_uintptr_type, - fold_build2 (MINUS_EXPR, mf_uintptr_type, mf_limit, mf_base), + v = fold_build2_loc (location, PLUS_EXPR, mf_uintptr_type, + fold_build2_loc (location, + MINUS_EXPR, mf_uintptr_type, mf_limit, mf_base), build_int_cst (mf_uintptr_type, 1)); v = force_gimple_operand (v, &stmts, true, NULL_TREE); gimple_seq_add_seq (&seq, stmts); @@ -863,16 +866,16 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp, if (elt) elt = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (elt)), elt); - addr = fold_convert (ptr_type_node, elt ? elt : base); - addr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, - addr, fold_convert (sizetype, - byte_position (field))); + addr = fold_convert_loc (location, ptr_type_node, elt ? elt : base); + addr = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node, + addr, fold_convert_loc (location, sizetype, + byte_position (field))); } else addr = build1 (ADDR_EXPR, build_pointer_type (type), t); - limit = fold_build2 (MINUS_EXPR, mf_uintptr_type, - fold_build2 (PLUS_EXPR, mf_uintptr_type, + limit = fold_build2_loc (location, MINUS_EXPR, mf_uintptr_type, + fold_build2_loc (location, PLUS_EXPR, mf_uintptr_type, convert (mf_uintptr_type, addr), size), integer_one_node); @@ -882,8 +885,9 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp, case INDIRECT_REF: addr = TREE_OPERAND (t, 0); base = addr; - limit = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, - fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, base, + limit = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node, + fold_build2_loc (location, + POINTER_PLUS_EXPR, ptr_type_node, base, size), size_int (-1)); break; @@ -891,8 +895,9 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp, case TARGET_MEM_REF: addr = tree_mem_ref_addr (ptr_type_node, t); base = addr; - limit = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, - fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, base, + limit = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node, + fold_build2_loc (location, + POINTER_PLUS_EXPR, ptr_type_node, base, size), size_int (-1)); break; @@ -914,21 +919,26 @@ mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp, bpu = bitsize_int (BITS_PER_UNIT); ofs = convert (bitsizetype, TREE_OPERAND (t, 2)); - rem = size_binop (TRUNC_MOD_EXPR, ofs, bpu); - ofs = fold_convert (sizetype, size_binop (TRUNC_DIV_EXPR, ofs, bpu)); + rem = size_binop_loc (location, TRUNC_MOD_EXPR, ofs, bpu); + ofs = fold_convert_loc (location, + sizetype, + size_binop_loc (location, + TRUNC_DIV_EXPR, ofs, bpu)); size = convert (bitsizetype, TREE_OPERAND (t, 1)); - size = size_binop (PLUS_EXPR, size, rem); - size = size_binop (CEIL_DIV_EXPR, size, bpu); + size = size_binop_loc (location, PLUS_EXPR, size, rem); + size = size_binop_loc (location, CEIL_DIV_EXPR, size, bpu); size = convert (sizetype, size); addr = TREE_OPERAND (TREE_OPERAND (t, 0), 0); addr = convert (ptr_type_node, addr); - addr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, addr, ofs); + addr = fold_build2_loc (location, POINTER_PLUS_EXPR, + ptr_type_node, addr, ofs); base = addr; - limit = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, - fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, + limit = fold_build2_loc (location, POINTER_PLUS_EXPR, ptr_type_node, + fold_build2_loc (location, + POINTER_PLUS_EXPR, ptr_type_node, base, size), size_int (-1)); } |