https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102764
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Eric Botcazou <ebotca...@gcc.gnu.org>: https://gcc.gnu.org/g:972ee845f54839e9bd2e4611bb268d75440f3845 commit r12-4531-g972ee845f54839e9bd2e4611bb268d75440f3845 Author: Eric Botcazou <ebotca...@adacore.com> Date: Wed Oct 20 10:42:56 2021 +0200 Fix PR middle-end/102764 This is a regression present on the mainline in the form of -fcompare-debug failure at -O3 on a compiler-generated testcase. Fixed by disregarding a debug statement in the last position of a basic block to reset the current location for the outgoing edges. gcc/ PR middle-end/102764 * cfgexpand.c (expand_gimple_basic_block): Disregard a final debug statement to reset the current location for the outgoing edges. gcc/testsuite/ * gcc.dg/pr102764.c: New test.