From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14735 invoked by alias); 17 Mar 2012 07:37:42 -0000 Received: (qmail 14637 invoked by uid 22791); 17 Mar 2012 07:37:41 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-wi0-f179.google.com (HELO mail-wi0-f179.google.com) (209.85.212.179) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 17 Mar 2012 07:37:27 +0000 Received: by wibhn6 with SMTP id hn6so1456707wib.8 for ; Sat, 17 Mar 2012 00:37:26 -0700 (PDT) Received: by 10.216.136.157 with SMTP id w29mr3238220wei.23.1331969846348; Sat, 17 Mar 2012 00:37:26 -0700 (PDT) Received: from localhost (rsandifo.gotadsl.co.uk. [82.133.89.107]) by mx.google.com with ESMTPS id t20sm8879215wiv.0.2012.03.17.00.37.25 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 17 Mar 2012 00:37:25 -0700 (PDT) From: Richard Sandiford To: Mike Stump Mail-Followup-To: Mike Stump ,gcc-patches Patches , rdsandiford@googlemail.com Cc: gcc-patches Patches Subject: Re: remove wrong code in immed_double_const References: <5FF5A724-3FE1-4E97-8124-542A0B8259FE@comcast.net> Date: Sat, 17 Mar 2012 07:37:00 -0000 In-Reply-To: <5FF5A724-3FE1-4E97-8124-542A0B8259FE@comcast.net> (Mike Stump's message of "Fri, 16 Mar 2012 14:54:06 -0700") Message-ID: <87obrvd6fh.fsf@talisman.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-03/txt/msg01199.txt.bz2 Mike Stump writes: > This removes some wrong code. > > Ok? > > Index: gcc/emit-rtl.c > =================================================================== > --- gcc/emit-rtl.c (revision 184563) > +++ gcc/emit-rtl.c (working copy) > @@ -540,8 +540,6 @@ immed_double_const (HOST_WIDE_INT i0, HO > > if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) > return gen_int_mode (i0, mode); > - > - gcc_assert (GET_MODE_BITSIZE (mode) == 2 * HOST_BITS_PER_WIDE_INT); > } > > /* If this integer fits in one word, return a CONST_INT. */ Is this because you have an integer mode between HOST_BITS_PER_WIDE_INT and 2 * HOST_BITS_PER_WIDE_INT? (I.e. a partial one?) If so, I can see an argument for changing the "==" to "<=", although we'd need to think carefully about what CONST_DOUBLE means in that case. (Endianness, etc.) Or is this because you have an integer mode wider than 2*OST_BITS_PER_WIDE_INT? We currently only support constant integer widths <= 2*HOST_BITS_PER_WIDE_INT, and the assert is correctly triggering if we try to build a wider constant. Obviously it'd be nice if we supported arbitrary widths, e.g. by replacing CONST_INT and CONST_DOUBLE with a single n-HOST_WIDE_INT rtx (and immed_double_const with some kind of nary builder, etc.). It won't be easy though. Removing the assert seems like papering over the problem. FWIW, here's another case where this came up: http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01220.html Richard