Committed, MMIX: Fix 64-bit host (opcodes/mmix-opc.c)

Hans-Peter Nilsson hp@bitrange.com
Sat Mar 19 18:53:00 GMT 2005


On Fri, 18 Mar 2005, H. J. Lu wrote:
> Please make sure that there are no unexpected failures in gas.

That's what I meant of course.  Now it does; if there are any
related ld failures they disappear in the breakage due to empty
size section removal.

(For the record, the value of (X << 24) where X=0xff depends on
the size of int and the type of the expression.  Easiest fixed
by forcing the type of X.)

I'll commit this to 2.16 too.

	* mmix-opc.c (O, Z): Force expression as unsigned long.

Index: mmix-opc.c
===================================================================
RCS file: /cvs/src/src/opcodes/mmix-opc.c,v
retrieving revision 1.2
diff -p -c -u -p -r1.2 mmix-opc.c
cvs diff: conflicting specifications of output style
--- mmix-opc.c	13 Dec 2003 14:56:24 -0000	1.2
+++ mmix-opc.c	19 Mar 2005 04:06:27 -0000
@@ -67,11 +67,11 @@ const struct mmix_spec_reg mmix_spec_reg
 /* All bits in the opcode-byte are significant.  Add "| ..."
expressions
    to add zero-bits.  */
 #undef O
-#define O(m) ((m) << 24), ((~(m) & 255) << 24)
+#define O(m) ((unsigned long) (m) << 24UL), ((~(unsigned long) (m) & 255) << 24)

 /* Bits 7..1 of the opcode are significant.  */
 #undef Z
-#define Z(m) ((m) << 24), ((~(m) & 254) << 24)
+#define Z(m) ((unsigned long) (m) << 24), ((~(unsigned long) (m) & 254) << 24)

 /* For easier overview of the table.  */
 #define N mmix_type_normal

brgds, H-P



More information about the Binutils mailing list