Commit 45c45e79 by Richard Kenner

(ASM_OUTPUT_{INT,SHORT,CHAR,BYTE}): Truncate constant to maximum range

permitted in order to avoid assembler error.

From-SVN: r3739
parent 5eb9c92c
...@@ -1462,9 +1462,9 @@ literal_section () \ ...@@ -1462,9 +1462,9 @@ literal_section () \
/* This is how to output an assembler line defining an `int' constant. */ /* This is how to output an assembler line defining an `int' constant. */
#define ASM_OUTPUT_INT(FILE,VALUE) \ #define ASM_OUTPUT_INT(FILE,VALUE) \
( fprintf (FILE, "\t.long "), \ fprintf (FILE, "\t.long %d\n", \
output_addr_const (FILE, (VALUE)), \ (GET_CODE (VALUE) == CONST_INT \
fprintf (FILE, "\n")) ? INTVAL (VALUE) & 0xffffffff : (abort (), 0)))
/* This is how to output an assembler line defining a `long' constant. */ /* This is how to output an assembler line defining a `long' constant. */
...@@ -1476,14 +1476,14 @@ literal_section () \ ...@@ -1476,14 +1476,14 @@ literal_section () \
/* Likewise for `char' and `short' constants. */ /* Likewise for `char' and `short' constants. */
#define ASM_OUTPUT_SHORT(FILE,VALUE) \ #define ASM_OUTPUT_SHORT(FILE,VALUE) \
( fprintf (FILE, "\t.word "), \ fprintf (FILE, "\t.short %d\n", \
output_addr_const (FILE, (VALUE)), \ (GET_CODE (VALUE) == CONST_INT \
fprintf (FILE, "\n")) ? INTVAL (VALUE) & 0xffff : (abort (), 0)))
#define ASM_OUTPUT_CHAR(FILE,VALUE) \ #define ASM_OUTPUT_CHAR(FILE,VALUE) \
( fprintf (FILE, "\t.byte "), \ fprintf (FILE, "\t.byte %d\n", \
output_addr_const (FILE, (VALUE)), \ (GET_CODE (VALUE) == CONST_INT \
fprintf (FILE, "\n")) ? INTVAL (VALUE) & 0xff : (abort (), 0)))
/* We use the default ASCII-output routine, except that we don't write more /* We use the default ASCII-output routine, except that we don't write more
than 50 characters since the assembler doesn't support very long lines. */ than 50 characters since the assembler doesn't support very long lines. */
...@@ -1548,7 +1548,7 @@ literal_section () \ ...@@ -1548,7 +1548,7 @@ literal_section () \
/* This is how to output an assembler line for a numeric constant byte. */ /* This is how to output an assembler line for a numeric constant byte. */
#define ASM_OUTPUT_BYTE(FILE,VALUE) \ #define ASM_OUTPUT_BYTE(FILE,VALUE) \
fprintf (FILE, "\t.byte 0x%x\n", (VALUE)) fprintf (FILE, "\t.byte 0x%x\n", (VALUE) & 0xff)
/* This is how to output an element of a case-vector that is absolute. */ /* This is how to output an element of a case-vector that is absolute. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment