From patchwork Fri May 13 13:57:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 95479 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 2E325B6EEE for ; Fri, 13 May 2011 23:57:55 +1000 (EST) Received: (qmail 3343 invoked by alias); 13 May 2011 13:57:53 -0000 Received: (qmail 3334 invoked by uid 22791); 13 May 2011 13:57:53 -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 mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 May 2011 13:57:39 +0000 Received: (qmail 17278 invoked from network); 13 May 2011 13:57:38 -0000 Received: from unknown (HELO rex.config) (julian@127.0.0.2) by mail.codesourcery.com with ESMTPA; 13 May 2011 13:57:38 -0000 Date: Fri, 13 May 2011 14:57:34 +0100 From: Julian Brown To: gcc-patches@gcc.gnu.org Subject: [PATCH] ARM fixed-point support [2/6]: assembler format for fixed-point constants Message-ID: <20110513145734.0a9f4277@rex.config> Mime-Version: 1.0 X-IsSubscribed: yes 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 changes the format used to print fixed-point constants from hex to decimal. For instance a negative "short fract" fixed-point constant may be represented as a signed HOST_WIDE_INT from -1 to -128, which would currently be printed as e.g. 0xfff....ffxx, resulting in a "bignum truncated to fit" warning from the assembler. This trouble is avoided if we just print using integers instead, similarly to the way signed character-constants are emitted elsewhere in the compiler. Tested along with the rest of the patch series. OK to apply? Julian ChangeLog * final.c (output_addr_const): Print fixed-point constants as decimal not hex (avoiding an assembler overflow warning for negative byte constants). commit 7c169485b6e5b153af02c83e8b858b8613ed7664 Author: Julian Brown Date: Fri May 13 05:44:19 2011 -0700 Tweak fixed-point constant format. diff --git a/gcc/final.c b/gcc/final.c index 7e1ae90..b147ddf 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -3633,8 +3633,7 @@ output_addr_const (FILE *file, rtx x) break; case CONST_FIXED: - fprintf (file, HOST_WIDE_INT_PRINT_HEX, - (unsigned HOST_WIDE_INT) CONST_FIXED_VALUE_LOW (x)); + fprintf (file, HOST_WIDE_INT_PRINT_DEC, CONST_FIXED_VALUE_LOW (x)); break; case PLUS: