I work with partial evaluation, where intermediate representations during compilation can get quite large, and have seen stack overflows in the compiler for real.
It would be nice if stacks were arbitrarily large anyway.
Note that if the language supports macros, you can't eliminate recursion from compile time; macro expanders can express recursion. (The same remark applies though: if user-defined macros blow a generous stack that is many megabytes long, oh well!)
Then add in very deep inlining.
And as I say I've seen it for real, in a real compiler, with a real program, while doing a real job. I could send the author an email and tell him his program is silly, but I'd rather be able to compile it.
Sometimes linear constructs can appear nested in the handling of the syntax.
You want to avoid right recursion in an LR parser for list-like constructs, especially if they can be reasonably expected to grow large. These constructs appear "flat" to the programmer, but the parser will push tokens onto the stack and not reduce anything until the end of the construct is reached.
I've seen output from compilers to JavaScript that convert huge switches into if cascades which are in fact quite deep: think tens to hundreds of thousands of cases converted to an if cascade.
Or put another way, not all programs are written by programmers.