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

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 22 Mar 2005 11:34:04 -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 lupus@ximian.com.

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

--- shadow/73936	2005-03-21 16:05:20.000000000 -0500
+++ shadow/73936.tmp.9081	2005-03-22 11:34:04.000000000 -0500
@@ -161,6 +161,25 @@
 No, we are able to do tail call optimizations in the jit. It's
 probably just not enabled because it may not be well tested.
 
 Seeing the bug that tail calls are slower on msft, it seems like that
 is another good reason not to emit them in mcs; we would slow down
 code that others run on msft.
+
+------- Additional Comments From lupus@ximian.com  2005-03-22 11:34 -------
+The best place for this optimization is in the jit and we have it
+there already, though it will fail in this particulra case:-(
+I have a fix in my tree for it.
+We don't have any policy of producing the same code as csc nor we care
+if some code pattern would make the code run slower on the MS runtime 
+(it is an idiotic excuse).
+But we do have the policy that the cheap optimizations are done in the
+jit, so that the code compiled with any compiler will benefit.
+Once the jit performs the optimizations (and it has to) there is no
+point complicating the C# compiler to do the same.
+In the particular case of tail recursion this allows us to also
+optionally enable or disable the optimization (this is important since
+many users write property accessors that recurse infinitely and the
+optimization hides the bug in an infinite loop instead of making the
+code hit a stack overflow).
+Once the jit optimization is properly tested we'll enable it by
+default: currently you need to use -O=tailc or -O=all.