From patchwork Wed Sep 11 18:39:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 274352 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C7AA32C00DA for ; Thu, 12 Sep 2013 04:40:08 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=r6ajO8/6birdZ1Bv LdNmcrIeq58xnAUlEvEygnWb4FguEZjfKzzummXkKfg9v6NDNK/dG0jh4Anl0W0i XjKFP+biU2u/7IEtRXnLbewjrEYKstJnbAFNVNRXywsohfYjviGPdjhlxST/g+D+ Mym6jJi7sQ7SS/DCCPCBoDmW+PE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=5VkdMVhtKBSgg3GngQvKKe 5wNuY=; b=KvLpUXX6n+CYy1+u4EXzuiRxmEbRmQiLgJkNxVtX30tROCriPTOGNp 4s4J/yAwqBZD4lyq6UlAPeB3YctvuVS4HHYlcqlD9uFAlzCU+KpneGYs+TZbZKkM sjnglwLRtlcKWAEA60WEjze2tAp9f2pF5DMNF6KzDIk+zp5BWo1tI= Received: (qmail 9592 invoked by alias); 11 Sep 2013 18:40:01 -0000 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 Received: (qmail 9580 invoked by uid 89); 11 Sep 2013 18:40:01 -0000 Received: from mail-wi0-f176.google.com (HELO mail-wi0-f176.google.com) (209.85.212.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 11 Sep 2013 18:40:01 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED, BAYES_00, FREEMAIL_FROM autolearn=ham version=3.3.2 X-HELO: mail-wi0-f176.google.com Received: by mail-wi0-f176.google.com with SMTP id cb5so2541776wib.3 for ; Wed, 11 Sep 2013 11:39:57 -0700 (PDT) X-Received: by 10.194.19.5 with SMTP id a5mr2696492wje.48.1378924797807; Wed, 11 Sep 2013 11:39:57 -0700 (PDT) Received: from localhost ([95.148.201.183]) by mx.google.com with ESMTPSA id iz19sm12574986wic.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 11 Sep 2013 11:39:56 -0700 (PDT) From: Richard Sandiford To: Graham Stott Mail-Followup-To: Graham Stott , James Greenhalgh , "gcc-patches\@gcc.gnu.org" , rdsandiford@googlemail.com Cc: James Greenhalgh , "gcc-patches\@gcc.gnu.org" Subject: Re: Using gen_int_mode instead of GEN_INT minot testsuite fallout on MIPS References: <1378833157-11511-1-git-send-email-james.greenhalgh@arm.com> <87y574mr2h.fsf@talisman.default> <1378900963.71148.YahooMailNeo@web87402.mail.ir2.yahoo.com> Date: Wed, 11 Sep 2013 19:39:45 +0100 In-Reply-To: <1378900963.71148.YahooMailNeo@web87402.mail.ir2.yahoo.com> (Graham Stott's message of "Wed, 11 Sep 2013 13:02:43 +0100 (BST)") Message-ID: <87y573kxse.fsf@talisman.default> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Graham Stott writes: > Hi Richard, > > There is some minor testsuite fallout with these patches on MIPS a > couple of tests (see below)ICE ingen_int_mode () in both these ICE the > mode is CCmode. Hmm, interesting. I suppose gen_int_mode should handle CC modes, since there's no other constant rtx that can be used instead. OTOH, like you say, it doesn't really make sense to apply try_const_anchor to CCmode. How does the following patch look? Thanks, Richard gcc/ * emit-rtl.c (gen_int_mode): Handle CC modes. * cse.c (try_const_anchors): ...but punt on them here. Index: gcc/emit-rtl.c =================================================================== --- gcc/emit-rtl.c 2013-09-08 11:52:15.000000000 +0100 +++ gcc/emit-rtl.c 2013-09-11 19:32:35.702377902 +0100 @@ -417,6 +417,11 @@ gen_rtx_CONST_INT (enum machine_mode mod rtx gen_int_mode (HOST_WIDE_INT c, enum machine_mode mode) { + /* CONST_INT is used for CC modes too. We can't make any assumptions + about the precision or bitsize in that case, so just pass the value + through unchanged. */ + if (GET_MODE_CLASS (mode) == MODE_CC) + return GEN_INT (c); return GEN_INT (trunc_int_for_mode (c, mode)); } Index: gcc/cse.c =================================================================== --- gcc/cse.c 2013-09-08 11:52:15.000000000 +0100 +++ gcc/cse.c 2013-09-11 19:38:17.664399826 +0100 @@ -1354,6 +1354,11 @@ try_const_anchors (rtx src_const, enum m rtx lower_exp = NULL_RTX, upper_exp = NULL_RTX; unsigned lower_old, upper_old; + /* CONST_INT is used for CC modes, but we should leave those alone. */ + if (GET_MODE_CLASS (mode) == MODE_CC) + return NULL_RTX; + + gcc_assert (SCALAR_INT_MODE_P (mode)); if (!compute_const_anchors (src_const, &lower_base, &lower_offs, &upper_base, &upper_offs)) return NULL_RTX;