]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/101278 - handle self-use in DSE analysis
authorRichard Biener <rguenther@suse.de>
Thu, 1 Jul 2021 09:16:01 +0000 (11:16 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 1 Jul 2021 10:31:21 +0000 (12:31 +0200)
commit4a87605938428f6c4c62d5b92cfc183cd2b2554e
treea9478e77889df404fa204eefb4b1ff89a54167b1
parenta3aaba68405751bae3f630669515b7ecdf77efa6
tree-optimization/101278 - handle self-use in DSE analysis

DSE store classification short-cuts the to-be classified stmt itself
from chaining but fails to first check whether the store uses itself
which can be the case when it is a call with the LHS also passed by
value as argument.

2021-07-01  Richard Biener  <rguenther@suse.de>

PR tree-optimization/101278
* tree-ssa-dse.c (dse_classify_store): First check for
uses, then ignore stmt for chaining purposes.

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