aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.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/tree-sra.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/tree-sra.c')
-rw-r--r--gcc/tree-sra.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 2381ac3..a7bb017 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1123,11 +1123,13 @@ static bool
build_ref_for_offset (tree *expr, tree type, HOST_WIDE_INT offset,
tree exp_type, bool allow_ptr)
{
+ location_t loc = expr ? EXPR_LOCATION (*expr) : UNKNOWN_LOCATION;
+
if (allow_ptr && POINTER_TYPE_P (type))
{
type = TREE_TYPE (type);
if (expr)
- *expr = fold_build1 (INDIRECT_REF, type, *expr);
+ *expr = fold_build1_loc (loc, INDIRECT_REF, type, *expr);
}
return build_ref_for_offset_1 (expr, type, offset, exp_type);
@@ -1968,6 +1970,7 @@ load_assign_lhs_subreplacements (struct access *lacc, struct access *top_racc,
enum unscalarized_data_handling *refreshed,
tree lhs)
{
+ location_t loc = EXPR_LOCATION (lacc->expr);
do
{
if (lacc->grp_to_be_replaced)
@@ -1982,7 +1985,7 @@ load_assign_lhs_subreplacements (struct access *lacc, struct access *top_racc,
{
rhs = get_access_replacement (racc);
if (!useless_type_conversion_p (lacc->type, racc->type))
- rhs = fold_build1 (VIEW_CONVERT_EXPR, lacc->type, rhs);
+ rhs = fold_build1_loc (loc, VIEW_CONVERT_EXPR, lacc->type, rhs);
}
else
{
@@ -2080,6 +2083,7 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi,
tree lhs, rhs;
bool modify_this_stmt = false;
bool force_gimple_rhs = false;
+ location_t loc = gimple_location (*stmt);
if (!gimple_assign_single_p (*stmt))
return SRA_SA_NONE;
@@ -2152,7 +2156,7 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi,
}
if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
{
- rhs = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (lhs), rhs);
+ rhs = fold_build1_loc (loc, VIEW_CONVERT_EXPR, TREE_TYPE (lhs), rhs);
if (!is_gimple_reg (lhs))
force_gimple_rhs = true;
}