]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/115388 - wrong DSE in irreductible regions
authorRichard Biener <rguenther@suse.de>
Mon, 10 Jun 2024 09:29:43 +0000 (11:29 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 10 Jun 2024 11:36:28 +0000 (13:36 +0200)
commit818e760528d436ea8f6c28ef620e2bb82d456ea1
tree671a601314d895afe49c8a9454e590b28b727489
parente29af8de31ba4b73dcee82917c8cec60d53dfa82
tree-optimization/115388 - wrong DSE in irreductible regions

The following fixes a latent bug in DSE with regarding to variant
array accesses where the code avoiding bogus DSE in loops fails to
handle irreducible regions.  For those we need to make sure backedges
are marked and discover a header for the irreducible region to check
invariantness.

PR tree-optimization/115388
* tree-ssa-dse.cc (dse_classify_store): Handle irreducible
regions.
(pass_dse::execute): Make sure to mark backedges.

* gcc.dg/torture/pr115388.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr115388.c [new file with mode: 0644]
gcc/tree-ssa-dse.cc