https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121103
--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Andrew Pinski <[email protected]>: https://gcc.gnu.org/g:c958e1e9833ca4e0fca633e6c71f9e4967f7be82 commit r15-10943-gc958e1e9833ca4e0fca633e6c71f9e4967f7be82 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]> (cherry picked from commit 36a5d12cca2bc3b6d06432f10206188c1799479e)
