While looking into fixing the PR, I discovered that we can set
DECL_NO_STATIC_CHAIN incorrectly. When nested functions call other
nested functions, they may need to pass along the original static chain.
This discovery is by nature iterative; we had been performing a single
pass over the nested function tree and setting DECL_NO_STATIC_CHAIN
based on that.
I think it boils down to what "incorrectly" means here. Starting with a
conservatively correct set of DECL_NO_STATIC_CHAIN flags, the old algorithm
will generate another conservatively correct set, not maximal of course.