[Mono-bugs] [Bug 43677][Nor] Changed - optimize=shared broken

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Tue, 27 May 2003 07:19:00 -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 vargaz@freemail.hu.

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

--- shadow/43677	Tue May 27 06:54:13 2003
+++ shadow/43677.tmp.32576	Tue May 27 07:19:00 2003
@@ -27,6 +27,53 @@
 run eclipse with ikvm, but I didn't have time to extract a test case yet).
 
 ------- Additional Comments From vargaz@freemail.hu  2003-05-27 06:54 -------
 Hi,
 
  I will track the eclipse problem down.
+
+------- Additional Comments From vargaz@freemail.hu  2003-05-27 07:18 -------
+It was easier than I thought :)
+
+Here is a testcase:
+
+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+using System;
+using System.IO;
+using System.Diagnostics;
+using System.Threading;
+
+struct Foo {
+	[ThreadStatic]
+	static Foo* o;
+
+	Foo* previous;
+
+	public unsafe void Enter () {
+		previous = o;
+		o = &this;
+
+		Console.WriteLine ("ENTER: " + (IntPtr)o + " " + (IntPtr)previous);
+	}
+}
+	
+
+class Proba {
+
+	public static void Main () {
+		Foo f = new Foo ();
+		f.Enter ();
+		f.Enter ();
+	}
+}
+
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+When running with --optimize=shared, this prints:
+ENTER: -1084229340 0
+ENTER: -1084229340 -1084229340
+
+When running without shared, it prints:
+ENTER: -1084229340 0
+ENTER: -1084229340 0
+