https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102764
--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- This seems to work: diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 03260b019e5..8b067f9d848 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -6090,7 +6090,7 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls) /* Expand implicit goto and convert goto_locus. */ FOR_EACH_EDGE (e, ei, bb->succs) { - if (e->goto_locus != UNKNOWN_LOCATION || !stmt) + if (e->goto_locus != UNKNOWN_LOCATION || !stmt || is_gimple_debug (stmt)) set_curr_insn_location (e->goto_locus); if ((e->flags & EDGE_FALLTHRU) && e->dest != bb->next_bb) {