From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3495 invoked by alias); 8 Jan 2007 23:08:55 -0000 Received: (qmail 3482 invoked by uid 22791); 8 Jan 2007 23:08:54 -0000 X-Spam-Check-By: sourceware.org Received: from ug-out-1314.google.com (HELO ug-out-1314.google.com) (66.249.92.170) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 08 Jan 2007 23:08:50 +0000 Received: by ug-out-1314.google.com with SMTP id s2so6262321uge for ; Mon, 08 Jan 2007 15:08:48 -0800 (PST) Received: by 10.82.111.8 with SMTP id j8mr2750826buc.1168297728264; Mon, 08 Jan 2007 15:08:48 -0800 (PST) Received: by 10.82.150.13 with HTTP; Mon, 8 Jan 2007 15:08:48 -0800 (PST) Message-ID: <84fc9c000701081508u3a0f8f94x5c9abd94c9cdeccb@mail.gmail.com> Date: Mon, 08 Jan 2007 23:08:00 -0000 From: "Richard Guenther" To: "Gcc Patch List" Subject: Re: [PATCH] Introduce force_fit_type_double, remove force_fit_type In-Reply-To: <84fc9c000701081237k678511e1nf82d3c17648a6a8a@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <84fc9c000701081237k678511e1nf82d3c17648a6a8a@mail.gmail.com> 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: 2007-01/txt/msg00621.txt.bz2 On 1/8/07, Richard Guenther wrote: > This patch removes force_fit_type in favor of force_fit_type_double that > takes a double-int and a type argument. This reduces intermediate types > created and cleans up the source as all uses left of force_fit_type are of > the form > > t = build_int_cst_wide (type, low, high); > t = force_fit_type (t, -1, overflow | TREE_OVERFLOW (arg1), > TREE_CONSTANT_OVERFLOW (arg1)); > > which first creates a shared integer node (of possibly uncanonicalized form) > and then truncates it properly and propagates overflow flags. Combining > this two steps also allows to adjust int_const_binop to produce less garbage > on overflow. > > Bootstrapped and tested on i686-pc-linux-gnu, another on on > x86_64-unknown-linux-gnu for all languages still running. Finished and applied to mainline (with the #if 0 / #endif block removed - thanks Ian ;) Richard. > 2007-01-08 Richard Guenther > > * tree.h (force_fit_type_double): Export. > (force_fit_type): Remove. > * fold-const.c (force_fit_type_double): New function. > (force_fit_type): Remove. > (int_const_binop): Use it. > (fold_convert_const_int_from_int): Likewise. > (fold_convert_const_int_from_real): Likewise. > (fold_div_compare): Likewise. > (fold_sign_changed_comparison): Likewise. > (fold_unary): Likewise. > (fold_negate_const): Likewise. > (fold_abs_const): Likewise. > (fold_not_const): Likewise. > * c-common.c (shorten_compare): Use force_fit_type_double. > * convert.c (convert_to_pointer): Likewise. > > >