> More references to input_location aren't ideal. But I don't think
> that's a strong enough reason to reject.
This can be avoided relatively easily though, patch to that effect attached.
Tested on x86-64/Linux, OK for the mainline?
* tree-inline.c (remap_gimple_stmt): Replace input_location with
gimple_location (id->call_stmt) throughout.
(copy_phis_for_bb): Likewise.
(expand_call_inline): Likewise. Tweak formatting.
--
Eric Botcazou
Index: tree-inline.c
===================================================================
--- tree-inline.c (revision 262207)
+++ tree-inline.c (working copy)
@@ -1631,7 +1631,7 @@ remap_gimple_stmt (gimple *stmt, copy_bo
gimple_debug_bind_get_value (stmt),
stmt);
if (id->reset_location)
- gimple_set_location (copy, input_location);
+ gimple_set_location (copy, gimple_location (id->call_stmt));
id->debug_stmts.safe_push (copy);
gimple_seq_add_stmt (&stmts, copy);
return stmts;
@@ -1643,7 +1643,7 @@ remap_gimple_stmt (gimple *stmt, copy_bo
gimple_debug_source_bind_get_value (stmt),
stmt);
if (id->reset_location)
- gimple_set_location (copy, input_location);
+ gimple_set_location (copy, gimple_location (id->call_stmt));
id->debug_stmts.safe_push (copy);
gimple_seq_add_stmt (&stmts, copy);
return stmts;
@@ -1658,7 +1658,7 @@ remap_gimple_stmt (gimple *stmt, copy_bo
gdebug *copy = as_a <gdebug *> (gimple_copy (stmt));
if (id->reset_location)
- gimple_set_location (copy, input_location);
+ gimple_set_location (copy, gimple_location (id->call_stmt));
id->debug_stmts.safe_push (copy);
gimple_seq_add_stmt (&stmts, copy);
return stmts;
@@ -1758,7 +1758,7 @@ remap_gimple_stmt (gimple *stmt, copy_bo
}
if (id->reset_location)
- gimple_set_location (copy, input_location);
+ gimple_set_location (copy, gimple_location (id->call_stmt));
/* Debug statements ought to be rebuilt and not copied. */
gcc_checking_assert (!is_gimple_debug (copy));
@@ -2386,7 +2386,7 @@ copy_phis_for_bb (basic_block bb, copy_b
}
locus = gimple_phi_arg_location_from_edge (phi, old_edge);
if (id->reset_location)
- locus = input_location;
+ locus = gimple_location (id->call_stmt);
else
locus = remap_location (locus, id);
add_phi_arg (new_phi, new_arg, new_edge, locus);
@@ -4336,8 +4336,8 @@ expand_call_inline (basic_block bb, gimp
gimple *simtenter_stmt = NULL;
vec<tree> *simtvars_save;
- /* The gimplifier uses input_location in too many places, such as
- internal_get_tmp_var (). */
+ /* FIXME: the gimplifier uses input_location in too many places,
+ such as internal_get_tmp_var. Cope with it for now. */
location_t saved_location = input_location;
input_location = gimple_location (stmt);
@@ -4559,12 +4559,18 @@ expand_call_inline (basic_block bb, gimp
GSI_NEW_STMT);
}
initialize_inlined_parameters (id, stmt, fn, bb);
- if (debug_nonbind_markers_p && debug_inline_points && id->block
+
+ if (debug_nonbind_markers_p
+ && debug_inline_points
+ && id->block
&& inlined_function_outer_scope_p (id->block))
{
gimple_stmt_iterator si = gsi_last_bb (bb);
- gsi_insert_after (&si, gimple_build_debug_inline_entry
- (id->block, input_location), GSI_NEW_STMT);
+ gsi_insert_after (&si,
+ gimple_build_debug_inline_entry (id->block,
+ gimple_location
+ (id->call_stmt)),
+ GSI_NEW_STMT);
}
if (DECL_INITIAL (fn))