[Mono-bugs] [Bug 73936][Min] Changed - gmcs does not optimize for space

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 21 Mar 2005 15:25:40 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by nazgul@omega.pl.

http://bugzilla.ximian.com/show_bug.cgi?id=73936

--- shadow/73936	2005-03-21 15:22:41.000000000 -0500
+++ shadow/73936.tmp.25448	2005-03-21 15:25:40.000000000 -0500
@@ -114,6 +114,25 @@
 
 About xplatform, what I am saying is that if you rely on -O=tailc,
 your program won't work on the msft jit unless they do something similar.
 
 In general, c# compilers don't make optimizations for recursive styles
 of programming as most people just don't do that in c#.
+
+------- Additional Comments From nazgul@omega.pl  2005-03-21 15:25 -------
+The self tail call optimization is very simple and it really helps in
+performance of some methods. In nemerle we do this optimization with
+much success.
+
+Simply, compiler instead of producing call to current method, should
+update its parameters with new values and jump to the beginning of
+method. This is altough only possible if call is the last instruction in 
+control flow (last instruction in method, its return value is
+immediately returned - 'return current_method (a,b,c);', etc.)
+
+The .tail prefix should not be used, because on MS.NET it makes things
+slower
+(http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?did=1&t=4pUuXAlfXBwZaLyAWxinehiq7qZrf5V6mK4nwlrLErGeauo6QmckGFWIQjoI0l56l3zxgu0R8fOA!K*qS!IZy2uw$$&p=4bxwvy9diGkDyDW7r0b2540!C5EqPdzzi3w2GFLMOe0FPK*kH2EvUhmPNrRGceTVgqln!puNMLQwpJ1aDbgcCKGNu6adUOAr!*!50iu6ZaF9Xs2wLbwMD75Cf0t7AoBoAr*B9qpFEb79Q$&feedbackid=58ece8e2-6914-4049-9d1a-2d040b705512)
+On mono it is faster though.
+
+The fact that csc do not optimize self tail call is the proof that it
+is lame compiler, not that this is the *right* thing.