I don't think tail-call optimization is something that is ever done in practice. It kinda changes the semantics of the code.
It's like detecting bubble sort and changing it to quicksort. Although tail-call optimization would be easier than that, it's not gonna happen.
Also, -O2 implies -foptimize-sibling-calls.
Name:
Anonymous2008-11-07 6:25
>>10
I think gcc does tail-call optimizations for C.
Name:
Anonymous2008-11-07 6:41
How about you just code it directly in ASM when you're so concerned about code quality? GCC has a pretty interesting inline ASM construct that also allows inlining and optimization of passed parameters.
Also lol 64bit OS.
Name:
Anonymous2008-11-07 15:20
>>10 It kinda changes the semantics of the code.
Wat.
Name:
Anonymous2008-11-07 15:26
>>13
Semantics = meaning.
Tail-call optimization changes the meaning of the original code, even though the output will still be the same. Kind of like how using bubble sort and quick sort will still sort a list, but the way they do it is different.
>>14
Why is this important if they're behaviorally congruent, assuming the generated code is faster?
Name:
Anonymous2008-11-07 19:14
>>14
All optimizations change how the code works. That's the whole fucking point; you can write your code normally, but the omniscient compiler will translate it into uber-faster code for you.
Name:
Anonymous2008-11-07 20:08
>>14
It won't change the meaning of the original C++ code. Stop being a fucking pedant, you furfag.