4 ms·
Then later, after some minor unrelated change, compiler stops optimizing and it suddenly starts overflowing the stack. How can anyone put up with that?
by rini17 7y ago
Then later, after some minor unrelated change, compiler stops optimizing and it suddenly starts overflowing the stack.
How can anyone put up with that?
- mhh__ 7y agoIf you rely on an optimization like this, that's not a code smell as much as a code-sewer: This is one of those optimizations that a very clever compiler might be able to do interprocedurally give a certain input for example.
- cryptonector 7y agoI expect the compiler would optimize the tail recursion into a loop, so the likely worst case is not that you blow the stack but that you spin for a while.
- rini17 7y agoNot really, any expectations here are unsupported by C standards. Compiler is, by spec, allowed to do anything here.