Patchwork pdp11: fix assembler warning

login
register
mail settings
Submitter Paul Koning
Date Nov. 9, 2010, noon
Message ID <C4267AB9-8802-4875-9349-015D96A3161D@dell.com>
Download mbox | patch
Permalink /patch/70534/
State New
Headers show

Comments

Paul Koning - Nov. 9, 2010, noon
On Nov 8, 2010, at 8:42 PM, Richard Henderson wrote:

> On 11/08/2010 05:08 PM, Paul Koning wrote:
>> +				 GEN_INT (trunc_int_for_mode (INTVAL (x),
>> +							      QImode) & 0xff));
> 
> This is gen_int_mode.
> 
>> +      fprintf (file, "%#o", (int) trunc_int_for_mode (INTVAL (x), HImode) & 0xffff);
> 
> Surely the & 0xffff isn't needed, since the value has already
> been truncated.  Alternately, if you want an HImode value as
> an unsigned number, then the trunc_int_for_mode isn't needed.

Fixed this way:

ChangeLog:

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

	* config/pdp11/pdp11.c (pdp11_assemble_integer): Clean up fix for
	output of byte values.

Patch

Index: config/pdp11/pdp11.c
===================================================================
--- config/pdp11/pdp11.c	(revision 166480)
+++ config/pdp11/pdp11.c	(working copy)
@@ -1002,9 +1002,7 @@ 
       {
       case 1:
 	fprintf (asm_out_file, "\t.byte\t");
-	output_addr_const_pdp11 (asm_out_file, 
-				 GEN_INT (trunc_int_for_mode (INTVAL (x),
-							      QImode) & 0xff));
+	output_addr_const_pdp11 (asm_out_file, GEN_INT (INTVAL (x) & 0xff));
 ;
 	fprintf (asm_out_file, " /* char */\n");
 	return true;
@@ -1742,7 +1740,7 @@ 
       break;
 
     case CONST_INT:
-      fprintf (file, "%#o", (int) trunc_int_for_mode (INTVAL (x), HImode) & 0xffff);
+      fprintf (file, "%#o", (int) INTVAL (x) & 0xffff);
       break;
 
     case CONST: