aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-omp.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2009-07-16 22:29:52 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2009-07-16 22:29:52 +0000
commitdb3927fb49c9f13a0da61a75d771f51dc7c45b92 (patch)
treee4de0ffc0a0ca77f35b03bf9e8a248a4b5735f6a /gcc/c-omp.c
parentc32097d8b4fb21997c571cf6520431fa7d06090f (diff)
downloadgcc-db3927fb49c9f13a0da61a75d771f51dc7c45b92.zip
gcc-db3927fb49c9f13a0da61a75d771f51dc7c45b92.tar.gz
gcc-db3927fb49c9f13a0da61a75d771f51dc7c45b92.tar.bz2
re PR c/40435 (Revision 148442 caused many regressions on trunk)
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. Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org> From-SVN: r149722
Diffstat (limited to 'gcc/c-omp.c')
-rw-r--r--gcc/c-omp.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/gcc/c-omp.c b/gcc/c-omp.c
index 5ec9f94..b949501 100644
--- a/gcc/c-omp.c
+++ b/gcc/c-omp.c
@@ -81,8 +81,7 @@ c_finish_omp_barrier (location_t loc)
tree x;
x = built_in_decls[BUILT_IN_GOMP_BARRIER];
- x = build_call_expr (x, 0);
- SET_EXPR_LOCATION (x, loc);
+ x = build_call_expr_loc (loc, x, 0);
add_stmt (x);
}
@@ -96,8 +95,7 @@ c_finish_omp_taskwait (location_t loc)
tree x;
x = built_in_decls[BUILT_IN_GOMP_TASKWAIT];
- x = build_call_expr (x, 0);
- SET_EXPR_LOCATION (x, loc);
+ x = build_call_expr_loc (loc, x, 0);
add_stmt (x);
}
@@ -175,8 +173,7 @@ c_finish_omp_flush (location_t loc)
tree x;
x = built_in_decls[BUILT_IN_SYNCHRONIZE];
- x = build_call_expr (x, 0);
- SET_EXPR_LOCATION (x, loc);
+ x = build_call_expr_loc (loc, x, 0);
add_stmt (x);
}
@@ -185,7 +182,7 @@ c_finish_omp_flush (location_t loc)
Helper function for c_finish_omp_for. */
static tree
-check_omp_for_incr_expr (tree exp, tree decl)
+check_omp_for_incr_expr (location_t loc, tree exp, tree decl)
{
tree t;
@@ -199,22 +196,25 @@ check_omp_for_incr_expr (tree exp, tree decl)
switch (TREE_CODE (exp))
{
CASE_CONVERT:
- t = check_omp_for_incr_expr (TREE_OPERAND (exp, 0), decl);
+ t = check_omp_for_incr_expr (loc, TREE_OPERAND (exp, 0), decl);
if (t != error_mark_node)
- return fold_convert (TREE_TYPE (exp), t);
+ return fold_convert_loc (loc, TREE_TYPE (exp), t);
break;
case MINUS_EXPR:
- t = check_omp_for_incr_expr (TREE_OPERAND (exp, 0), decl);
+ t = check_omp_for_incr_expr (loc, TREE_OPERAND (exp, 0), decl);
if (t != error_mark_node)
- return fold_build2 (MINUS_EXPR, TREE_TYPE (exp), t, TREE_OPERAND (exp, 1));
+ return fold_build2_loc (loc, MINUS_EXPR,
+ TREE_TYPE (exp), t, TREE_OPERAND (exp, 1));
break;
case PLUS_EXPR:
- t = check_omp_for_incr_expr (TREE_OPERAND (exp, 0), decl);
+ t = check_omp_for_incr_expr (loc, TREE_OPERAND (exp, 0), decl);
if (t != error_mark_node)
- return fold_build2 (PLUS_EXPR, TREE_TYPE (exp), t, TREE_OPERAND (exp, 1));
- t = check_omp_for_incr_expr (TREE_OPERAND (exp, 1), decl);
+ return fold_build2_loc (loc, PLUS_EXPR,
+ TREE_TYPE (exp), t, TREE_OPERAND (exp, 1));
+ t = check_omp_for_incr_expr (loc, TREE_OPERAND (exp, 1), decl);
if (t != error_mark_node)
- return fold_build2 (PLUS_EXPR, TREE_TYPE (exp), TREE_OPERAND (exp, 0), t);
+ return fold_build2_loc (loc, PLUS_EXPR,
+ TREE_TYPE (exp), TREE_OPERAND (exp, 0), t);
break;
default:
break;
@@ -322,7 +322,7 @@ c_finish_omp_for (location_t locus, tree declv, tree initv, tree condv,
{
TREE_OPERAND (cond, 0) = TREE_OPERAND (op0, 0);
TREE_OPERAND (cond, 1)
- = fold_build1 (NOP_EXPR, TREE_TYPE (decl),
+ = fold_build1_loc (elocus, NOP_EXPR, TREE_TYPE (decl),
TREE_OPERAND (cond, 1));
}
else if (TREE_CODE (op1) == NOP_EXPR
@@ -330,7 +330,7 @@ c_finish_omp_for (location_t locus, tree declv, tree initv, tree condv,
{
TREE_OPERAND (cond, 1) = TREE_OPERAND (op1, 0);
TREE_OPERAND (cond, 0)
- = fold_build1 (NOP_EXPR, TREE_TYPE (decl),
+ = fold_build1_loc (elocus, NOP_EXPR, TREE_TYPE (decl),
TREE_OPERAND (cond, 0));
}
@@ -396,11 +396,12 @@ c_finish_omp_for (location_t locus, tree declv, tree initv, tree condv,
if (POINTER_TYPE_P (TREE_TYPE (decl))
&& TREE_OPERAND (incr, 1))
{
- tree t = fold_convert (sizetype, TREE_OPERAND (incr, 1));
+ tree t = fold_convert_loc (elocus,
+ sizetype, TREE_OPERAND (incr, 1));
if (TREE_CODE (incr) == POSTDECREMENT_EXPR
|| TREE_CODE (incr) == PREDECREMENT_EXPR)
- t = fold_build1 (NEGATE_EXPR, sizetype, t);
+ t = fold_build1_loc (elocus, NEGATE_EXPR, sizetype, t);
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (decl), decl, t);
incr = build2 (MODIFY_EXPR, void_type_node, decl, t);
}
@@ -422,7 +423,8 @@ c_finish_omp_for (location_t locus, tree declv, tree initv, tree condv,
incr_ok = true;
else
{
- tree t = check_omp_for_incr_expr (TREE_OPERAND (incr, 1),
+ tree t = check_omp_for_incr_expr (elocus,
+ TREE_OPERAND (incr, 1),
decl);
if (t != error_mark_node)
{