diff options
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 9352acc..b2cddc2 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -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. */ 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); BLOCK_ABSTRACT_ORIGIN (id->block) = fn; - BLOCK_SOURCE_LOCATION (id->block) - = LOCATION_LOCUS (gimple_location (stmt)); + BLOCK_SOURCE_LOCATION (id->block) = loc; prepend_lexical_block (gimple_block (stmt), id->block); } |