]> git.ipfire.org Git - thirdparty/gcc.git/commit
target/111600 - avoid deep recursion in access diagnostics
authorRichard Biener <rguenther@suse.de>
Thu, 28 Sep 2023 09:51:30 +0000 (11:51 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 28 Sep 2023 13:12:06 +0000 (15:12 +0200)
commitf194c684a28a5d449bd034a2c604d04ba465e4fe
tree3b81ce5cc8dce976a805c779013046d894e5f41d
parent4f41d497c9eeec6f97a5c240e03c7e5e1a1ec05e
target/111600 - avoid deep recursion in access diagnostics

pass_waccess::check_dangling_stores uses recursion to traverse the CFG.
The following changes this to use a heap allocated worklist to avoid
blowing the stack.

Instead of using a better iteration order it tries hard to preserve
the current iteration order to avoid new false positives to pop up
since the set of stores we keep track isn't properly modeling flow,
so what is diagnosed and what not is quite random.  We are also
lacking the ideal RPO compute on the inverted graph that would just
ignore reverse unreachable code (as the current iteration scheme does).

PR target/111600
* gimple-ssa-warn-access.cc (pass_waccess::check_dangling_stores):
Use a heap allocated worklist for CFG traversal instead of
recursion.
gcc/gimple-ssa-warn-access.cc