From patchwork Tue Nov 9 01:08:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Koning X-Patchwork-Id: 70482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id DE887B6F14 for ; Tue, 9 Nov 2010 12:08:39 +1100 (EST) Received: (qmail 16733 invoked by alias); 9 Nov 2010 01:08:38 -0000 Received: (qmail 16724 invoked by uid 22791); 9 Nov 2010 01:08:37 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ausc60pc101.us.dell.com (HELO ausc60pc101.us.dell.com) (143.166.85.206) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Nov 2010 01:08:33 +0000 X-Loopcount0: from 10.152.240.141 From: Paul Koning Subject: [PATCH] pdp11: fix assembler warning Date: Mon, 8 Nov 2010 20:08:29 -0500 Message-Id: <1A550A31-E248-4230-943B-7B3F7622013C@dell.com> To: gcc-patches Mime-Version: 1.0 (Apple Message framework v1081) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * 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: