From patchwork Fri May 31 08:57:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 247868 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 CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 870322C013D for ; Fri, 31 May 2013 18:57:53 +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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; q=dns; s= default; b=JqgrJCD4u5T05dgTCioWO/q1XYNvA1xVn/sfrmcgsxmkjXbAJpdS5 Nnnn4Ne++FHTXRMV9ZzHeu6R+3/1uZja/w/ddPaVOWkmBe9aXT4FK+X1CTnGTSy1 us27PFPfBNMPF/zpqmPx/gudfgMZBqIp/yQCHRSRe7y3MzKWJUS2b8= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=default; bh=+S16byx+Pgou7s3d4HDlMeMIR+s=; b=mMuh/0kGPzN85LyvaC4NEcGVRH/u wbgXSbk3h38X3QdxPkPah0Qenh60b1OMNOSW/b4ISA4Kr2K1qTCp2iUHVOwWowMs 6wa+8nG8SVXVaeP+hfNMbODfTag7gUlikkfU7JPx5Bj/Lx2lvOUfMR9w1myt7dCe 5GawJXhyxhSD86g= Received: (qmail 10628 invoked by alias); 31 May 2013 08:57:47 -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 10616 invoked by uid 89); 31 May 2013 08:57:47 -0000 X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 31 May 2013 08:57:45 +0000 Received: from archimedes.net-b.de (port-92-195-106-97.dynamic.qsc.de [92.195.106.97]) by mx02.qsc.de (Postfix) with ESMTP id 33A5A2773F; Fri, 31 May 2013 10:57:41 +0200 (CEST) Message-ID: <51A86605.2030106@net-b.de> Date: Fri, 31 May 2013 10:57:41 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: Richard Biener CC: Jeff Law , gcc patches , Thomas Koenig Subject: Re: PR57073 - Optimize __builtin_powif (-1.0, k) to k & 1 ? -1.0 : 1.0 References: <51A79580.2010001@net-b.de> <51A79A25.6080607@redhat.com> <51A7B8D7.2010001@net-b.de> <51A7BC87.1030801@redhat.com> In-Reply-To: Richard Biener wrote: > Why sink the !host_integerp check? Please keep it where it is now. > Then > > + if (real_minus_onep (arg0) > + && TREE_CODE (TREE_TYPE (arg1)) == INTEGER_TYPE > > this check is redundant, too. Good point - I will commit the patch below after another bootstrap and regtesting. Tobias arg0, n); --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -1448,7 +1448,9 @@ execute_cse_sincos (void) loc = gimple_location (stmt); - if (real_minus_onep (arg0) - && TREE_CODE (TREE_TYPE (arg1)) == INTEGER_TYPE - && !host_integerp (arg1,0)) + if (!host_integerp (arg1, 0)) + break; + + + if (real_minus_onep (arg0)) { tree t0, t1, cond, one, minus_one; @@ -1477,7 +1479,4 @@ execute_cse_sincos (void) else { - if (!host_integerp (arg1, 0)) - break; - n = TREE_INT_CST_LOW (arg1); result = gimple_expand_builtin_powi (&gsi, loc,