I'm wondering if it was theoretically possible for a compiler to determine maximum stack depth at compile time if a limitation was placed on the program. The limitation being that you can't use recursion or cyclic calls. With cyclic calls I don't mean loops but function calls (a -> b, b -> a). The program flow would then have to follow an directed acyclic graph basically.
Under these circumstances, can every program still be written or are there programs that can only work without above limitations?