News for hackers. Stuff that matters.
Re:How recursion got into programming: a comedy of errors by supergauntlet on Wednesday July 23, 2014 @07:32AM (#8073759)
C++ optimizes only with -O2 or /O2 passed to the compiler (for GCC and MSVC++, not sure about Clang).
Re:How recursion got into programming: a comedy of errors by pflanze on Wednesday July 23, 2014 @08:59AM (#8074083)
You can't count on it in the general case even with gcc (even when taking care to heed the restrictions like not passing pointers to data on the stack, and putting all functions into the same compilation unit). I did tests a couple years ago where it would compile up to about a handful of mutually recursive functions with TCO, then when you added one more, it would disable TCO. I guess because some algorithm will stop analyzing the call graph past a certain mark and then disallow TCO from being applied.
Re:How recursion got into programming: a comedy of errors by pjmlp on Thursday July 24, 2014 @02:43AM (#8078421)
If it isn't on the standard, anything goes.

There are much more compilers out there than those three.