From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3592 invoked by alias); 22 Mar 2012 14:12:48 -0000 Received: (qmail 3582 invoked by uid 22791); 22 Mar 2012 14:12:47 -0000 X-SWARE-Spam-Status: No, hits=-5.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Mar 2012 14:12:34 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 2EFDF90B96; Thu, 22 Mar 2012 15:12:33 +0100 (CET) Date: Thu, 22 Mar 2012 14:12:00 -0000 From: Michael Matz To: Mike Stump Cc: Richard Sandiford , gcc-patches Patches Subject: Re: remove wrong code in immed_double_const In-Reply-To: Message-ID: References: <5FF5A724-3FE1-4E97-8124-542A0B8259FE@comcast.net> <87obrvd6fh.fsf@talisman.home> <87haxmgqoo.fsf@talisman.home> <7C6A7462-C1D3-4765-83FF-3B3C726D92E5@comcast.net> <8762e09sgc.fsf@talisman.home> <0A5CBD0C-FC94-4637-B230-1A83372DE91A@comcast.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes 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/msg01507.txt.bz2 Hi, On Wed, 21 Mar 2012, Mike Stump wrote: > --- a/gcc/emit-rtl.c > +++ b/gcc/emit-rtl.c > @@ -531,10 +531,9 @@ immed_double_const (HOST_WIDE_INT i0, HOST_WIDE_INT i1, enum machine_mode mode) > > 1) If GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT, then we use > gen_int_mode. > - 2) GET_MODE_BITSIZE (mode) == 2 * HOST_BITS_PER_WIDE_INT, but the value of > - the integer fits into HOST_WIDE_INT anyway (i.e., i1 consists only > - from copies of the sign bit, and sign of i0 and i1 are the same), then > - we return a CONST_INT for i0. > + 2) If the value of the integer fits into HOST_WIDE_INT anyway > + (i.e., i1 consists only from copies of the sign bit, and sign > + of i0 and i1 are the same), then we return a CONST_INT for i0. I see that you didn't remove the assert as part of this patch. I'd like to see what you like to do to this routine once the rest goes in. In particular I don't think just removing the assert will be enough, at the very least the block comment should be saying something about what the routine exactly does (or doesn't do) for modes where the two HWI arguments can't specify all bits. My point is, for large modes i0 and i1 will only specify the low 2*HWIbits bits. Something needs to document what the upper bits will be (be they implicit or explicit), otherwise people reading the comment will always wonder what exactly is supposed to happen. I'm not 100% sure what it should say, though. Probably the interpretation of the upper bits depends on the users of the so generated CONST_DOUBLEs. Ciao, Michael.