[Mono-bugs] [Bug 55885][Wis] Changed - MCS generates bad code for switches on flags type enums

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 21 Mar 2004 23:19:19 -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 bmaurer@users.sf.net.


--- shadow/55885	2004-03-21 22:53:47.000000000 -0500
+++ shadow/55885.tmp.31594	2004-03-21 23:19:19.000000000 -0500
@@ -1,14 +1,14 @@
 Bug#: 55885
 Product: Mono: Compilers
 Version: unspecified
+OS: unknown
 OS Details: 
 Status: NEW   
+Severity: Unknown
 Priority: Wishlist
 Component: C#
 AssignedTo: bmaurer@users.sf.net                            
 ReportedBy: bmaurer@users.sf.net               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -147,6 +147,17 @@
 Note the method was 32kb long.
 Obviously, our alg for making the switch table needs some tuning.
 Inside the mcs code, I found at least one instance of this issue,
 Modifiers::Name, the method is 16kb long.
+------- Additional Comments From bmaurer@users.sf.net  2004-03-21 23:19 -------
+Ok, so the issue is this code:
+if ((kbCurr.Length + kb.Length) * 2 >=  KeyBlock.TotalLength (kbCurr, kb))
+Basically, it says
+`oh, look, 1 and 2 are pretty close, lets make them a block'
+`oh, look, 2 and 4 are pretty close, lets make them a block'
+`oh, look, 2^30 and 2^31 are pretty close, lets make them a block'