From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47100 invoked by alias); 18 May 2015 12:35:02 -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 47036 invoked by uid 89); 18 May 2015 12:35:01 -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,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mail3-relais-sop.national.inria.fr Received: from mail3-relais-sop.national.inria.fr (HELO mail3-relais-sop.national.inria.fr) (192.134.164.104) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 18 May 2015 12:35:00 +0000 Received: from eduroam-162a.sophia.inria.fr ([193.51.208.162]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 May 2015 14:34:56 +0200 Date: Mon, 18 May 2015 12:40:00 -0000 From: Marc Glisse To: Richard Biener cc: Jeff Law , GCC Patches Subject: Re: [RFA] More type narrowing in match.pd V2 In-Reply-To: Message-ID: References: <55441BF2.60703@redhat.com> <5554B11E.8090705@redhat.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-SW-Source: 2015-05/txt/msg01563.txt.bz2 On Mon, 18 May 2015, Richard Biener wrote: > On Thu, May 14, 2015 at 4:28 PM, Jeff Law wrote: >> On 05/14/2015 08:04 AM, Marc Glisse wrote: >>> >>> On Fri, 1 May 2015, Jeff Law wrote: >>> >>>> Slight refactoring of the condition by using types_match as suggested >>>> by Richi. I also applied the new types_match to 2 other patterns in >>>> match.pd where it seemed clearly appropriate. >>> >>> >>> I would like to propose this small tweak (regtested ok). If we had a >>> different type for trees and types, this would be overloading the >>> function. We already do this in a few places, and I find the resulting >>> shorter code more readable. >>> >>> 2015-05-14 Marc Glisse >>> >>> * generic-match-head.c (types_match): Handle non-types. >>> * gimple-match-head.c (types_match): Likewise. >>> * match.pd: Remove unnecessary TREE_TYPE for types_match. >> >> Update the comment for types_match and this is fine. > > No - it breaks genmatch autodetection of what trees escape. It special-cases > TREE_TYPE (). See capture_info::walk_c_expr: Oh, I didn't know that. > /* Give up for C exprs mentioning captures not inside TREE_TYPE (). */ > unsigned p_depth = 0; > > so the patch will pessimize GENERIC folding. > > Please do not apply. I think it was already applied. Feel free to revert it, or tell me and I'll do it next week-end (from your next message I don't really know if it should be reverted or not). -- Marc Glisse