[Bug tree-optimization/99101] optimization bug with -ffinite-loops
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 24 15:09:33 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99101
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
So we can massage post-dom compute to make control dependence which is defined
in terms of pdom do what we want. We have
void
dom_info::calc_dfs_tree ()
{
...
/* In the post-dom case we may have nodes without a path to EXIT_BLOCK.
They are reverse-unreachable. In the dom-case we disallow such
nodes, but in post-dom we have to deal with them.
There are two situations in which this occurs. First, noreturn
functions. Second, infinite loops. In the first case we need to
pretend that there is an edge to the exit block. In the second
case, we wind up with a forest. We need to process all noreturn
blocks before we know if we've got any infinite loops. */
which then first visits blocks w/o successors, breaking our expectations.
So with that in mind indeed connecting infinite loops to exit would
circumvent the issue, but connect_infinite_loops_to_exit does not
reliably avoid making the edge from the noreturn block (if that came first),
dfs_find_deadend also likes noreturn blocks very much.
Heuristically one could use loop info, but that fails to work for irreducible
regions. One could also use marked backedges from a forward DFS walk
(blocks with just backedges outgoing).
More information about the Gcc-bugs
mailing list