This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] pdp11: fix assembler warning

This patch cures a number of "value truncated" assembler warnings that show up in the testsuite.

Tested by build and make check.  Committed.



2010-11-08  Paul Koning  <>

	* config/pdp11/pdp11.c (pdp11_assemble_integer): Mask byte values
	to 8 bits.

Index: config/pdp11/pdp11.c
--- config/pdp11/pdp11.c	(revision 166433)
+++ config/pdp11/pdp11.c	(working copy)
@@ -1002,7 +1002,10 @@
       case 1:
 	fprintf (asm_out_file, "\t.byte\t");
-	output_addr_const_pdp11 (asm_out_file, x);
+	output_addr_const_pdp11 (asm_out_file, 
+				 GEN_INT (trunc_int_for_mode (INTVAL (x),
+							      QImode) & 0xff));
 	fprintf (asm_out_file, " /* char */\n");
 	return true;
@@ -1739,9 +1742,7 @@
     case CONST_INT:
-      /* Should we check for constants which are too big?  Maybe cutting
-	 them off to 16 bits is OK?  */
-      fprintf (file, "%#ho", (unsigned short) INTVAL (x));
+      fprintf (file, "%#o", (int) trunc_int_for_mode (INTVAL (x), HImode) & 0xffff);
     case CONST:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]