]> 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>
Tue, 30 Apr 2024 06:37:30 +0000 (08:37 +0200)
commit440a612dbadfae5887ec7c9b3ab2fca88b065366
tree90809d366eeeb8a0e630f0b82694061a07391851
parent88f22217521564e1a956e14ac55456caa160e055
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.

(cherry picked from commit f194c684a28a5d449bd034a2c604d04ba465e4fe)
gcc/gimple-ssa-warn-access.cc