From: Eric Botcazou Date: Fri, 12 Jul 2019 09:35:21 +0000 (+0000) Subject: cfgexpand.c (expand_gimple_stmt_1): If the statement doesn't have location... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e067f9924bad423bf6265b75414d3160e6cf660a;p=gcc.git cfgexpand.c (expand_gimple_stmt_1): If the statement doesn't have location... * cfgexpand.c (expand_gimple_stmt_1) : If the statement doesn't have location, set the current location to the function's end From-SVN: r273434 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 66e715f42e9..e75e1ec8da6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-07-12 Eric Botcazou + + * cfgexpand.c (expand_gimple_stmt_1) : If the statement + doesn't have location, set the current location to the function's end. + 2019-07-12 Richard Sandiford * config/aarch64/aarch64.md (*compare_condjump) 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 (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);