[Mono-bugs] [Bug 55901][Wis] New - We do not do complete folding of string concating
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Mon, 22 Mar 2004 12:39:25 -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.
http://bugzilla.ximian.com/show_bug.cgi?id=55901
--- shadow/55901 2004-03-22 12:39:25.000000000 -0500
+++ shadow/55901.tmp.3478 2004-03-22 12:39:25.000000000 -0500
@@ -0,0 +1,57 @@
+Bug#: 55901
+Product: Mono: Compilers
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: bmaurer@users.sf.net
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: We do not do complete folding of string concating
+
+If you compile the following code:
+
+using System;
+
+class T {
+ static void Main ()
+ {
+ string name = "foo";
+ Console.WriteLine ("Enumerator value for '" + name + "' is too large to " +
+ "fit in its type");
+ }
+}
+
+the il code is:
+
+ IL_0000: ldstr "foo"
+ IL_0005: stloc.0
+ IL_0006: ldstr "Enumerator value for '"
+ IL_000b: ldloc.0
+ IL_000c: ldstr "' is too large to "
+ IL_0011: ldstr "fit in its type"
+ IL_0016: call string valuetype
+[mscorlib]'System.String'::'Concat'(string, string, string, string)
+ IL_001b: call void class
+[mscorlib]'System.Console'::'WriteLine'(string)
+ IL_0020: ret
+
+
+ IL_000c: ldstr "' is too large to "
+ IL_0011: ldstr "fit in its type"
+ IL_0016: call string valuetype
+[mscorlib]'System.String'::'Concat'(string, string, string, string)
+
+is redundant, the string should be folded at compile time, so that you have:
+
+
+ IL_000c: ldstr "' is too large to fit in its type"
+
+and then concat with 3 arguments.