From patchwork Fri Jul 30 02:06:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 60328 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 04D75B70BD for ; Fri, 30 Jul 2010 12:07:04 +1000 (EST) Received: (qmail 17883 invoked by alias); 30 Jul 2010 02:07:02 -0000 Received: (qmail 17746 invoked by uid 22791); 30 Jul 2010 02:07:00 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-gx0-f175.google.com (HELO mail-gx0-f175.google.com) (209.85.161.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Jul 2010 02:06:56 +0000 Received: by gxk2 with SMTP id 2so448191gxk.20 for ; Thu, 29 Jul 2010 19:06:54 -0700 (PDT) Received: by 10.101.11.29 with SMTP id o29mr1199500ani.151.1280455614075; Thu, 29 Jul 2010 19:06:54 -0700 (PDT) Received: from napoca (cpe-70-120-196-107.austin.res.rr.com [70.120.196.107]) by mx.google.com with ESMTPS id 14sm2531624ant.21.2010.07.29.19.06.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Jul 2010 19:06:53 -0700 (PDT) Received: by napoca (sSMTP sendmail emulation); Thu, 29 Jul 2010 21:06:47 -0500 From: Sebastian Pop To: gcc-patches@gcc.gnu.org Cc: gcc-graphite@googlegroups.com, Sebastian Pop Subject: [PATCH 2/3] Generate in priority signed types for integer constants. Date: Thu, 29 Jul 2010 21:06:36 -0500 Message-Id: <1280455597-2075-3-git-send-email-sebpop@gmail.com> In-Reply-To: <1280455597-2075-1-git-send-email-sebpop@gmail.com> References: <1280455597-2075-1-git-send-email-sebpop@gmail.com> 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 2010-07-29 Sebastian Pop * graphite-clast-to-gimple.c (gcc_type_for_interval): Generate in priority signed types. --- gcc/ChangeLog.graphite | 5 +++++ gcc/graphite-clast-to-gimple.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index 9898a8c..8278652 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,5 +1,10 @@ 2010-07-29 Sebastian Pop + * graphite-clast-to-gimple.c (gcc_type_for_interval): Generate in + priority signed types. + +2010-07-29 Sebastian Pop + * graphite-clast-to-gimple.c (max_signed_precision_type): Remove the call to lang_hooks.types.type_for_size. Call build_nonstandard_integer_type. diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c index 534c88e..c642d19 100644 --- a/gcc/graphite-clast-to-gimple.c +++ b/gcc/graphite-clast-to-gimple.c @@ -459,9 +459,6 @@ gcc_type_for_interval (mpz_t low, mpz_t up) gcc_assert (mpz_cmp (low, up) <= 0); - if (mpz_sgn (low) < 0) - unsigned_p = false; - prec_up = precision_for_value (up); prec_int = precision_for_interval (low, up); precision = MAX (prec_up, prec_int); @@ -472,6 +469,15 @@ gcc_type_for_interval (mpz_t low, mpz_t up) return integer_type_node; } + if (mpz_sgn (low) <= 0) + unsigned_p = false; + + else if (precision < BITS_PER_WORD) + { + unsigned_p = false; + precision++; + } + mode = smallest_mode_for_size (precision, MODE_INT); precision = GET_MODE_PRECISION (mode); type = build_nonstandard_integer_type (precision, unsigned_p);