[Mono-bugs] [Bug 40903][Blo] New - MCS generates invalid code with pointers & longs

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Mon, 7 Apr 2003 17:48:52 -0400 (EDT)


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.

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

--- shadow/40903	Mon Apr  7 17:48:52 2003
+++ shadow/40903.tmp.19449	Mon Apr  7 17:48:52 2003
@@ -0,0 +1,53 @@
+Bug#: 40903
+Product: Mono/MCS
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: MCS generates invalid code with pointers & longs
+
+Description of Problem:
+MCS generates code that gives the wrong answer for the following:
+using System;
+namespace TestCase {
+	public unsafe class Test {
+		static void Main(string[] args) {
+			uint[] uArr = {100, 200};
+
+			fixed (uint *u = uArr) {
+				Console.WriteLine ("Result: {0}", DoOp 
+(u));
+			}
+		}
+
+		private static uint DoOp (uint *u) {
+			ulong val = 0xabcdabcdabcc;
+			*(++u) += (uint)val;
+			return *u;
+		}
+
+	}
+}
+
+
+Steps to reproduce the problem:
+1. Compile the above code with mcs, run it on any runtime (mono, mini, ms)
+
+Actual Results:
+Result: 2894583288
+
+Expected Results:
+Result: 2882382996
+
+How often does this happen? 
+Always