https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116156

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>:

https://gcc.gnu.org/g:33baa20c5cdcf5ff8164606115f00aa30f559312

commit r15-2691-g33baa20c5cdcf5ff8164606115f00aa30f559312
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>

Reply via email to