tree-optimization/97559 - fix sinking in irreducible regions
authorRichard Biener <rguenther@suse.de>
Tue, 8 Dec 2020 08:45:57 +0000 (09:45 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 8 Dec 2020 09:36:47 +0000 (10:36 +0100)
commita294e6368f80ac27c5150414027d1cf2a21bd9b7
tree6197ad62b1f7ec2c39deaaad7ed3b459ec6d17b9
parent3a6e3ad38a17a03ee0139b49a0946e7b9ded1eb1
tree-optimization/97559 - fix sinking in irreducible regions

This fixes sinking of loads when irreducible regions are involved
and the heuristics to find stores on the path along the sink
breaks down since that uses dominator queries.

2020-12-08  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97559
* tree-ssa-sink.c (statement_sink_location): Never ignore
PHIs on sink paths in irreducible regions.

* gcc.dg/torture/pr97559-1.c: New testcase.
* gcc.dg/torture/pr97559-2.c: Likewise.
gcc/testsuite/gcc.dg/torture/pr97559-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr97559-2.c [new file with mode: 0644]
gcc/tree-ssa-sink.c