aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2012-11-01 00:08:51 +0000
committerDehao Chen <dehao@google.com>2012-11-01 00:08:51 +0000
commit99168f0d380b15a05a36edca5e890c1e3f8d4e73 (patch)
tree06a68854befb9c71d71c7a7a73535a6958147b76 /gcc/expr.c
parent4c1777a61645bd3f6ef7fa7c0af81f12c4b58f93 (diff)
gcc:
2012-10-31 Dehao Chen <dehao@google.com> * tree-eh.c (do_return_redirection): Set location for jump statement. (do_goto_redirection): Likewise. (frob_into_branch_around): Likewise. (lower_try_finally_nofallthru): Likewise. (lower_try_finally_copy): Likewise. (lower_try_finally_switch): Likewise. * expr.c (store_expr): Use current insn location instead of expr location. (expand_expr_real): Likewise. (expand_expr_real_1): Likewise. gcc/testsuite: 2012-10-31 Dehao Chen <dehao@google.com> * g++.dg/debug/dwarf2/block.C: New testcase. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@193053 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c41
1 files changed, 12 insertions, 29 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index db20e9cb635..0ad3b578f17 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5024,7 +5024,7 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal)
{
rtx temp;
rtx alt_rtl = NULL_RTX;
- location_t loc = EXPR_LOCATION (exp);
+ location_t loc = curr_insn_location ();
if (VOID_TYPE_P (TREE_TYPE (exp)))
{
@@ -7863,31 +7863,7 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode,
return ret ? ret : const0_rtx;
}
- /* If this is an expression of some kind and it has an associated line
- number, then emit the line number before expanding the expression.
-
- We need to save and restore the file and line information so that
- errors discovered during expansion are emitted with the right
- information. It would be better of the diagnostic routines
- used the file/line information embedded in the tree nodes rather
- than globals. */
- if (cfun && EXPR_HAS_LOCATION (exp))
- {
- location_t saved_location = input_location;
- location_t saved_curr_loc = curr_insn_location ();
- input_location = EXPR_LOCATION (exp);
- set_curr_insn_location (input_location);
-
- ret = expand_expr_real_1 (exp, target, tmode, modifier, alt_rtl);
-
- input_location = saved_location;
- set_curr_insn_location (saved_curr_loc);
- }
- else
- {
- ret = expand_expr_real_1 (exp, target, tmode, modifier, alt_rtl);
- }
-
+ ret = expand_expr_real_1 (exp, target, tmode, modifier, alt_rtl);
return ret;
}
@@ -9244,8 +9220,15 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
g = SSA_NAME_DEF_STMT (exp);
if (g)
{
- rtx r = expand_expr_real (gimple_assign_rhs_to_tree (g), target,
- tmode, modifier, NULL);
+ rtx r;
+ location_t saved_loc = input_location;
+
+ input_location = gimple_location (g);
+ set_curr_insn_location (input_location);
+ r = expand_expr_real (gimple_assign_rhs_to_tree (g), target,
+ tmode, modifier, NULL);
+ input_location = saved_loc;
+ set_curr_insn_location (saved_loc);
if (REG_P (r) && !REG_EXPR (r))
set_reg_attrs_for_decl_rtl (SSA_NAME_VAR (exp), r);
return r;
@@ -9475,7 +9458,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
with non-BLKmode values. */
gcc_assert (GET_MODE (ret) != BLKmode);
- val = build_decl (EXPR_LOCATION (exp),
+ val = build_decl (curr_insn_location (),
VAR_DECL, NULL, TREE_TYPE (exp));
DECL_ARTIFICIAL (val) = 1;
DECL_IGNORED_P (val) = 1;