]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/118717 - store commoning vs. abnormals
authorRichard Biener <rguenther@suse.de>
Mon, 3 Feb 2025 08:55:50 +0000 (09:55 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 24 Feb 2025 10:47:57 +0000 (11:47 +0100)
commit93e7442f0845e4ee5222a2370eb1a83d513939aa
treeaf683a0ff8f1780949a7e2279a35ead30418967b
parent422f65add32acd1ebb3c09fd4837456898348c17
tree-optimization/118717 - store commoning vs. abnormals

When we sink common stores in cselim or the sink pass we have to
make sure to not introduce overlapping lifetimes for abnormals
used in the ref.  The easiest is to avoid sinking stmts which
reference abnormals at all which is what the following does.

PR tree-optimization/118717
* tree-ssa-phiopt.cc (cond_if_else_store_replacement_1):
Do not common stores referencing abnormal SSA names.
* tree-ssa-sink.cc (sink_common_stores_to_bb): Likewise.

* gcc.dg/torture/pr118717.c: New testcase.

(cherry picked from commit fbcbbfe2bf83eb8b1347144eeca37b06be5a8bb5)
gcc/testsuite/gcc.dg/torture/pr118717.c [new file with mode: 0644]
gcc/tree-ssa-phiopt.cc
gcc/tree-ssa-sink.cc