https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116156
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>: https://gcc.gnu.org/g:14fa2b2ae7f49dee5e7e7469243e281e48d925b9 commit r14-10552-g14fa2b2ae7f49dee5e7e7469243e281e48d925b9 Author: Andrew Pinski <quic_apin...@quicinc.com> Date: Thu Aug 1 10:33:34 2024 -0700 forwprop: Don't add uses to dce list if debug statement [PR116156] The problem here is that when forwprop does a copy prop, into a statement, we mark the uses of that statement as possibly need to be removed. But it just happened that statement was a debug statement, there will be a difference when compiling with debuging info turned on vs off; this is not expected. So the fix is not to add the old use to dce list to process if it was a debug statement. Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/116156 gcc/ChangeLog: * tree-ssa-forwprop.cc (pass_forwprop::execute): Don't add uses if the statement was a debug statement. gcc/testsuite/ChangeLog: * c-c++-common/torture/pr116156-1.c: New test. Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com>