[Mono-bugs] [Bug 39314][Nor] New - incorrect opcodes for some fp comparisons

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Fri, 7 Mar 2003 12:17:11 -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 lupus@ximian.com.

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

--- shadow/39314	Fri Mar  7 12:17:11 2003
+++ shadow/39314.tmp.25504	Fri Mar  7 12:17:11 2003
@@ -0,0 +1,47 @@
+Bug#: 39314
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lupus@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: incorrect opcodes for some fp comparisons
+
+mcs generates the following code to implement bool val = a <= a:
+        IL_0052: ldloc.0
+        IL_0053: ldloc.0
+        IL_0054: cgt
+        IL_0056: ldc.i4.0
+        IL_0057: ceq
+while cvs generates:
+        IL_004d: ldstr "NAN <= NAN: {0}"
+        IL_0052: ldloc.0
+        IL_0053: ldloc.0
+        IL_0054: cgt.un
+        IL_0056: ldc.i4.0
+        IL_0057: ceq
+and for bool val = a >= a:
+        IL_0068: ldloc.0
+        IL_0069: ldloc.0
+        IL_006a: clt
+        IL_006c: ldc.i4.1
+        IL_006d: sub
+versus the csc output:
+        IL_0068: ldloc.0
+        IL_0069: ldloc.0
+        IL_006a: clt.un
+        IL_006c: ldc.i4.0
+        IL_006d: ceq
+
+Attached a fairly complete test case.
+You can compare the opcodes generated or run the program with either mini
+or the MS runtime to check for the correctness of the generated code.