https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117892
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Martin Jambor <jamb...@gcc.gnu.org>: https://gcc.gnu.org/g:3d07e7bf13d4aec794dd25b5090c139b4d78283d commit r15-7269-g3d07e7bf13d4aec794dd25b5090c139b4d78283d Author: Martin Jambor <mjam...@suse.cz> Date: Wed Jan 29 10:51:08 2025 +0100 tree-ssa-dce: Avoid creating invalid BBs with no outgoing edge (PR117892) Zhendong Su and Michal Jireš found out that our gimple DSE pass can, under fairly specific conditions, remove a noreturn call which then leaves behind a "normal" BB with no successor edges which following passes do not expect. This patch simply tells the pass to leave such calls alone even when they otherwise appear to be dead. Interestingly, our CFG verifier does not report this. I'll put on my todo list to add a test for it in the next stage 1. gcc/ChangeLog: 2025-01-28 Martin Jambor <mjam...@suse.cz> PR tree-optimization/117892 * tree-ssa-dse.cc (dse_optimize_call): Leave control-altering noreturn calls alone. gcc/testsuite/ChangeLog: 2025-01-27 Martin Jambor <mjam...@suse.cz> PR tree-optimization/117892 * gcc.dg/tree-ssa/pr117892.c: New test. * gcc.dg/tree-ssa/pr118517.c: Likewise. co-authored-by: Michal Jireš <mji...@suse.cz>