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

--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <[email protected]>:

https://gcc.gnu.org/g:36a5d12cca2bc3b6d06432f10206188c1799479e

commit r16-7598-g36a5d12cca2bc3b6d06432f10206188c1799479e
Author: Andrew Pinski <[email protected]>
Date:   Sun Feb 1 21:08:54 2026 -0800

    fold/dse: Don't simplify/remove noreturn functions [PR121103]

    This fixes 2 related bugs. The user marks memmove as noreturn
    so when we simplify the memmove to a memory load/store there
    is no longer a statement that can alter the CFG and things go
    down hill.
    The same is true for removing the call in DSE.
    So the fix is not to simplify/take into account the call from
    gimple-fold and DSE.

    changes since v1:
     * v2: Use gimple_call_ctrl_altering_p instead of flags.

    Bootstrapped and tested on x86_64-linux-gnu.

            PR tree-optimization/121103

    gcc/ChangeLog:

            * gimple-fold.cc (gimple_fold_call): Don't simplify
            noreturn functions.
            * tree-ssa-dse.cc (dse_optimize_stmt): Don't handle
            calls to noreturn functions.

    gcc/testsuite/ChangeLog:

            * gcc.dg/torture/pr121103-1.c: New test.

    Signed-off-by: Andrew Pinski <[email protected]>

Reply via email to