From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27262 invoked by alias); 11 Aug 2015 12:51:32 -0000 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 Received: (qmail 27251 invoked by uid 89); 11 Aug 2015 12:51:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-io0-f174.google.com Received: from mail-io0-f174.google.com (HELO mail-io0-f174.google.com) (209.85.223.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 11 Aug 2015 12:51:31 +0000 Received: by iods203 with SMTP id s203so3657543iod.0 for ; Tue, 11 Aug 2015 05:51:29 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.107.137.87 with SMTP id l84mr32510116iod.119.1439297489435; Tue, 11 Aug 2015 05:51:29 -0700 (PDT) Received: by 10.107.32.140 with HTTP; Tue, 11 Aug 2015 05:51:29 -0700 (PDT) In-Reply-To: References: Date: Tue, 11 Aug 2015 12:51:00 -0000 Message-ID: Subject: Re: [PR25529] Convert (unsigned t * 2)/2 into unsigned (t & 0x7FFFFFFF) From: Richard Biener To: "Hurugalawadi, Naveen" Cc: "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00515.txt.bz2 On Tue, Aug 11, 2015 at 2:50 PM, Richard Biener wrote: > On Fri, Aug 7, 2015 at 10:43 AM, Hurugalawadi, Naveen > wrote: >> Hi, >> >>>> extend it - it should also work for non-INTEGER_CST >>>> divisors and it should work for any kind of division, not just exact_div. >> >> Please find attached the patch "pr25529.patch" that implements the pattern >> for all divisors >> >> Please review and let me know if its okay. > > Ok. Err, sorry. You are missing a ANY_INTEGRAL_TYPE_P (type) before the TYPE_OVERFLOW_UNDEFINED check which should simply operate on 'type' rather than TREE_TYPE (@0). Ok with that changes. Richard. > Thanks, > Richard. > >> Regression tested on AARH64 and x86_64. >> >> Thanks, >> Naveen >> >> 2015-08-07 Naveen H.S >> >> PR middle-end/25529 >> >> gcc/ChangeLog: >> * match.pd (div (mult @0 @1) @1) : New simplifier. >>