public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] pdp11: fix assembler warning
@ 2010-11-09  1:11 Paul Koning
  2010-11-09  1:45 ` Richard Henderson
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Koning @ 2010-11-09  1:11 UTC (permalink / raw)
  To: gcc-patches

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

Tested by build and make check.  Committed.

	paul

ChangeLog:

2010-11-08  Paul Koning  <ni1d@arrl.net>

	* 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 @@
       break;
 
     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);
       break;
 
     case CONST:

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-09 12:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-09  1:11 [PATCH] pdp11: fix assembler warning Paul Koning
2010-11-09  1:45 ` Richard Henderson
2010-11-09 12:00   ` Paul Koning
2010-11-09 12:00   ` Paul Koning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).