From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29020 invoked by alias); 10 May 2010 11:35:16 -0000 Received: (qmail 29002 invoked by uid 22791); 10 May 2010 11:35:15 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM X-Spam-Check-By: sourceware.org Received: from mail-gy0-f175.google.com (HELO mail-gy0-f175.google.com) (209.85.160.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 May 2010 11:35:09 +0000 Received: by gya1 with SMTP id 1so1712821gya.20 for ; Mon, 10 May 2010 04:35:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.103.12 with SMTP id a12mr9699635ybc.112.1273491306553; Mon, 10 May 2010 04:35:06 -0700 (PDT) Received: by 10.151.11.21 with HTTP; Mon, 10 May 2010 04:35:06 -0700 (PDT) In-Reply-To: <1559627802414B63BF3F07A934C165C7@Vista> References: <1811669158.20100507225908@post.ru> <4EE7DEB362344819B080B47ED2A9E4DB@Vista> <1559627802414B63BF3F07A934C165C7@Vista> Date: Mon, 10 May 2010 11:35:00 -0000 Message-ID: Subject: Re: Remove build_int_cst_wide_type function. From: Richard Guenther To: Anatoly Sokolov Cc: gcc-patches@gcc.gnu.org, java-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2010-q2/txt/msg00020.txt.bz2 On Mon, May 10, 2010 at 1:17 PM, Anatoly Sokolov wrote: > > ----- Original Message ----- From: "Richard Guenther" > > To: "Anatoly Sokolov" > Cc: ; > Sent: Monday, May 10, 2010 2:34 PM > Subject: Re: Remove build_int_cst_wide_type function. > > >>> Can I remame build_int_cst/build_int_cstu functions to >>> hwi_to_tree/uhwi_to_tree? >> >> Hmm - there are a lot of calls to these, I'd prefer to leave them >> as is for now. =A0If we can make build_int_cst_wide local to tree.c >> then maybe - it would be a consistent iterface. =A0But as long >> as that stays I see no reason to do it now. >> > > The build_int_cstu used 24 times only. The build_int_cst used 876 times, = but > in most uses in get NULL_TREE as fitst argument that forces to do checks = in > the build_int_cst =A0function: > ... > =A0/* Support legacy code. =A0*/ > =A0if (!type) > =A0 type =3D integer_type_node; > ... > > If change NULL_TREE to integer_type_node in all calls the build_int_cst > function then =A0build_int_cst may be simplified to inline function: > > static inline tree > build_int_cst/shwi_to_tree (tree type, HOST_WIDE_INT low) > { > =A0return double_int_to_tree (type, shwi_to_double_int (low)); > } > > I.e., can do two changes for the cost of one. The callers with NULL type should probably be reviewed separately. Some of them might want to use the simpler size_int interface (even if that changes the type from integer_type_node to size_type_node). Some obvious ones indeed explicitly want integer_type_node. Lumping both changes together will make it hard to track down those persisting errors. NULL_TREE at least tells us that this is a suspicious case. Richard. > Anatoly. >