aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-ssa-isolate-paths.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimple-ssa-isolate-paths.c')
-rw-r--r--gcc/gimple-ssa-isolate-paths.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/gimple-ssa-isolate-paths.c b/gcc/gimple-ssa-isolate-paths.c
index eb23cd4..2dafe84 100644
--- a/gcc/gimple-ssa-isolate-paths.c
+++ b/gcc/gimple-ssa-isolate-paths.c
@@ -400,6 +400,11 @@ diag_returned_locals (bool maybe, const locmap_t &locmap)
gimple *stmt = (*it).first;
const args_loc_t &argsloc = (*it).second;
location_t stmtloc = gimple_location (stmt);
+ if (stmtloc == UNKNOWN_LOCATION)
+ /* When multiple return statements are merged into one it
+ may not have an associated location. Use the location
+ of the closing brace instead. */
+ stmtloc = cfun->function_end_locus;
auto_diagnostic_group d;
unsigned nargs = argsloc.locvec.length ();