summaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-01 13:27:17 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-01 13:27:17 +0000
commit0d2ca7d0afb823b4c2cdbca9b7fad16293e9e157 (patch)
tree9547b380d1a2c44a3e59318a182617e73a7f912f /gcc/expr.c
parent6c090767759b61160f60d6e0d74b5563ba7a90aa (diff)
downloadgcc-0d2ca7d0afb823b4c2cdbca9b7fad16293e9e157.tar.gz
2015-09-01 Richard Biener <rguenther@suse.de>
* expr.c (expand_expr_real_1): For expanding TERed defs set the current location to that of the def if not UNKNOWN. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227370 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 1e820b45a24..ee0c1f93249 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -9463,6 +9463,10 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
if (g)
{
rtx r;
+ location_t saved_loc = curr_insn_location ();
+ location_t loc = gimple_location (g);
+ if (loc != UNKNOWN_LOCATION)
+ set_curr_insn_location (loc);
ops.code = gimple_assign_rhs_code (g);
switch (get_gimple_rhs_class (ops.code))
{
@@ -9484,21 +9488,19 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
case GIMPLE_UNARY_RHS:
ops.op0 = gimple_assign_rhs1 (g);
ops.type = TREE_TYPE (gimple_assign_lhs (g));
- ops.location = gimple_location (g);
+ ops.location = loc;
r = expand_expr_real_2 (&ops, target, tmode, modifier);
break;
case GIMPLE_SINGLE_RHS:
{
- location_t saved_loc = curr_insn_location ();
- set_curr_insn_location (gimple_location (g));
r = expand_expr_real (gimple_assign_rhs1 (g), target,
tmode, modifier, NULL, inner_reference_p);
- set_curr_insn_location (saved_loc);
break;
}
default:
gcc_unreachable ();
}
+ 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;