https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104702
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> --- The warning mapping needs to be updated whenever a location of a tree or gimple* changes (gimple_set_block() calls gimple_set_location() which calls copy_warning() so that part at least should work). I saw code in the C++ front end that doesn't do that when working on the warning control stuff but had no good way to find it all; my expectation was that it would get discovered as bugs like this one cropped up.