Skip to content
Snippets Groups Projects
Unverified Commit 3d07e7bf authored by Martin Jambor's avatar Martin Jambor Committed by Martin Jambor
Browse files

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  <mjambor@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  <mjambor@suse.cz>

	PR tree-optimization/117892
	* gcc.dg/tree-ssa/pr117892.c: New test.
	* gcc.dg/tree-ssa/pr118517.c: Likewise.

co-authored-by: default avatarMichal Jireš <mjires@suse.cz>
parent 5a48079c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment