]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/98845 - ICE with tail-merging and DCE/DSE disabled
authorRichard Biener <rguenther@suse.de>
Mon, 17 Feb 2025 14:53:11 +0000 (15:53 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 18 Feb 2025 07:55:47 +0000 (08:55 +0100)
commit6b8a8c9fd68c5dabaec5ddbc25efeade44f37a14
treec46bd4ff7cc97fbdb0720979a3138f962fb19084
parentb22f191b7c594b33fb4b4a07769dbf0ca45bc9e9
tree-optimization/98845 - ICE with tail-merging and DCE/DSE disabled

The following shows that tail-merging will make dead SSA defs live
in paths where it wasn't before, possibly introducing UB or as
in this case, uses of abnormals that eventually fail coalescing
later.  The fix is to register such defs for stmt comparison.

PR tree-optimization/98845
* tree-ssa-tail-merge.cc (stmt_local_def): Consider a
def with no uses not local.

* gcc.dg/pr98845.c: New testcase.
* gcc.dg/pr81192.c: Adjust.
gcc/testsuite/gcc.dg/pr81192.c
gcc/testsuite/gcc.dg/pr98845.c [new file with mode: 0644]
gcc/tree-ssa-tail-merge.cc