https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90949
--- Comment #6 from Jeffrey A. Law <law at redhat dot com> --- In response to c#5. The difference is when you use a bool for cleanup, it has to be promoted at the recursive call call to walk(). That's just enough to change the decision between using tail call (which still looks like a call) and tail recursion elimination which turns the recursive call into a simple backwards jump. In the former case (bool) we never have the copy propagation opportunity that triggers the problem. In the latter case, the backwards jump creates a loop and we determine it's profitable to copy the loop header which creates the PHI node with the dead incoming edge that triggers the copy propagation that causes the problems.