[Mono-bugs] [Bug 23547] Changed - Windening integers should clear high bits of the result

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
25 Apr 2002 02:23:33 -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 gonzalo@ximian.com.

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

--- shadow/23547	Mon Apr 22 12:33:26 2002
+++ shadow/23547.tmp.11018	Wed Apr 24 22:23:33 2002
@@ -36,6 +36,23 @@
 RESULT: 0
 
 ------- Additional Comments From gonzalo@ximian.com  2002-04-17 21:01 -------
 Created an attachment (id=1623)
 Casting an int to gint64 extends the sign. Includes workaround.
 
+
+------- Additional Comments From gonzalo@ximian.com  2002-04-24 22:23 -------
+The code below is what gcc generates for the C program attached above:
+--------------
+        movl $-1,-4(%ebp)
+.stabn 68,0,11,.LM3-main
+.LM3:
+        addl $-4,%esp
+        pushl $8
+        movl -4(%ebp),%ecx
+        movl %ecx,%eax
+        cltd
+----------------
+
+Always extends sign! It should not do that if a) the variable is
+unsigned, b) we are casting to an unsigned type.
+