Commit 392047f9 by Richard Biener Committed by Richard Biener

re PR debug/87428 ("Missed" inline instances cause bogus DWARF to be emitted)

2018-09-26  Richard Biener  <rguenther@suse.de>

	PR debug/87428
	PR debug/87362
	* tree-inline.c (expand_call_inline): When the location
	of the call is UNKNOWN_LOCATION use DECL_SOURCE_LOCATION
	or BUILTINS_LOCATION for the BLOCK_SOURCE_LOCATION of
	the inserted BLOCK to make inlined_function_outer_scope_p
	recognize it.
	* dwarf2out.c (add_call_src_coords_attributes): Do not add
	coords for reserved locations.

From-SVN: r264594
parent 201054a7
2018-09-26 Richard Biener <rguenther@suse.de>
PR debug/87428
PR debug/87362
* tree-inline.c (expand_call_inline): When the location
of the call is UNKNOWN_LOCATION use DECL_SOURCE_LOCATION
or BUILTINS_LOCATION for the BLOCK_SOURCE_LOCATION of
the inserted BLOCK to make inlined_function_outer_scope_p
recognize it.
* dwarf2out.c (add_call_src_coords_attributes): Do not add
coords for reserved locations.
2018-09-25 Segher Boessenkool <segher@kernel.crashing.org> 2018-09-25 Segher Boessenkool <segher@kernel.crashing.org>
* config/rs6000/rs6000.md (*movcc_internal1): Use set_attr_alternative. * config/rs6000/rs6000.md (*movcc_internal1): Use set_attr_alternative.
......
...@@ -23907,6 +23907,10 @@ gen_label_die (tree decl, dw_die_ref context_die) ...@@ -23907,6 +23907,10 @@ gen_label_die (tree decl, dw_die_ref context_die)
static inline void static inline void
add_call_src_coords_attributes (tree stmt, dw_die_ref die) add_call_src_coords_attributes (tree stmt, dw_die_ref die)
{ {
/* We can end up with BUILTINS_LOCATION here. */
if (RESERVED_LOCATION_P (BLOCK_SOURCE_LOCATION (stmt)))
return;
expanded_location s = expand_location (BLOCK_SOURCE_LOCATION (stmt)); expanded_location s = expand_location (BLOCK_SOURCE_LOCATION (stmt));
if (dwarf_version >= 3 || !dwarf_strict) if (dwarf_version >= 3 || !dwarf_strict)
......
...@@ -4527,10 +4527,16 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id) ...@@ -4527,10 +4527,16 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id)
not refer to them in any way to not break GC for locations. */ not refer to them in any way to not break GC for locations. */
if (gimple_block (stmt)) if (gimple_block (stmt))
{ {
/* We do want to assign a not UNKNOWN_LOCATION BLOCK_SOURCE_LOCATION
to make inlined_function_outer_scope_p return true on this BLOCK. */
location_t loc = LOCATION_LOCUS (gimple_location (stmt));
if (loc == UNKNOWN_LOCATION)
loc = LOCATION_LOCUS (DECL_SOURCE_LOCATION (fn));
if (loc == UNKNOWN_LOCATION)
loc = BUILTINS_LOCATION;
id->block = make_node (BLOCK); id->block = make_node (BLOCK);
BLOCK_ABSTRACT_ORIGIN (id->block) = fn; BLOCK_ABSTRACT_ORIGIN (id->block) = fn;
BLOCK_SOURCE_LOCATION (id->block) BLOCK_SOURCE_LOCATION (id->block) = loc;
= LOCATION_LOCUS (gimple_location (stmt));
prepend_lexical_block (gimple_block (stmt), id->block); prepend_lexical_block (gimple_block (stmt), id->block);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment