[Mono-bugs] [Bug 71576][Wis] New - ABCREM should obtain relationship info from % operators

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 21 Jan 2005 10:31: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 vargaz@gmail.com.

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

--- shadow/71576	2005-01-21 10:31:19.000000000 -0500
+++ shadow/71576.tmp.30051	2005-01-21 10:31:19.000000000 -0500
@@ -0,0 +1,37 @@
+Bug#: 71576
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: JIT
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vargaz@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: ABCREM should obtain relationship info from % operators
+
+Take the following code:
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+using System;
+
+class Tests
+{
+	public static void Main() {
+		int[] arr = new int [10];
+
+		int sum = 0;
+		for (int i = 0; i < 100; ++i)
+			sum += arr [i % 10];
+	}
+}
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+Here, the array bound check could be removed, since i % 10 is guaranteed 
+to be >=0 and < 10. This type of code is common in hashtables, like our
+own System.Collections.Hashtable:Find method ().