diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2019-07-12 09:35:21 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2019-07-12 09:35:21 +0000 |
commit | e067f9924bad423bf6265b75414d3160e6cf660a (patch) | |
tree | 21cabb5d871a9a5f717cadd8ad2d6835a9376bdc /gcc/cfgexpand.c | |
parent | e7ba492a04d0bfef9752cbb16fcce3ffc31bf99f (diff) |
cfgexpand.c (expand_gimple_stmt_1): If the statement doesn't have location...
* cfgexpand.c (expand_gimple_stmt_1) <GIMPLE_RETURN>: If the statement
doesn't have location, set the current location to the function's end
From-SVN: r273434
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index d0c1d31a2cc..33af991573f 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -3714,6 +3714,12 @@ expand_gimple_stmt_1 (gimple *stmt) { op0 = gimple_return_retval (as_a <greturn *> (stmt)); + /* If a return doesn't have a location, it very likely represents + multiple user returns so we cannot let it inherit the location + of the last statement of the previous basic block in RTL. */ + if (!gimple_has_location (stmt)) + set_curr_insn_location (cfun->function_end_locus); + if (op0 && op0 != error_mark_node) { tree result = DECL_RESULT (current_function_decl); |