[Mono-bugs] [Bug 24772] New - MCS miscompiles certain loops
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
15 May 2002 18:03:20 -0000
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 crichton@gimp.org.
http://bugzilla.ximian.com/show_bug.cgi?id=24772
--- shadow/24772 Wed May 15 14:03:20 2002
+++ shadow/24772.tmp.26631 Wed May 15 14:03:20 2002
@@ -0,0 +1,84 @@
+Bug#: 24772
+Product: Mono/MCS
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: crichton@gimp.org
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: MCS miscompiles certain loops
+
+MCS miscompiles the following code:
+
+using System;
+
+namespace test
+{
+ class test
+ {
+ public static void Main()
+ {
+ int i,j;
+ float[][] a;
+ a = new float[20][];
+ a[0] = new float[20];
+ a[1] = new float[20];
+ a[2] = new float[20];
+ int dim = 2, ch = 2;
+ int chptr = 0;
+
+ for(i=0; i<16;)
+ {
+ Console.Error.WriteLine("i: "+i);
+ for(j=0; j < dim; j++)
+ {
+ a[chptr++][i]+=6.022f;
+ if(chptr == ch)
+ {
+ chptr = 0;
+ i++;
+ }
+ }
+ }
+ }
+ }
+}
+
+MCS output:
+mono ./test.exe
+i: 0
+i: 2
+i: 4
+i: 6
+i: 8
+i: 10
+i: 12
+i: 14
+RESULT: 0
+
+MS runtime:
+$ ./test.exe
+i: 0
+i: 1
+i: 2
+i: 3
+i: 4
+i: 5
+i: 6
+i: 7
+i: 8
+i: 9
+i: 10
+i: 11
+i: 12
+i: 13
+i: 14
+i: 15