3 ms·
"If we'd be worried about our ability to analyze these then we wouldn't be able to optimize away that special case to begin with. " Most compilers require you
by DannyBee 12y ago
"If we'd be worried about our ability to analyze these then we wouldn't be able to optimize away that special case to begin with.
"
Most compilers require you tell them, specifically, that it can tail call everything, before it will do it (i'm talking more about GCC and LLVM here, which are generic compiler frameworks). It will do some tail call optimization, but only fairly basic cases, exactly because it can't analyze what will happen.