From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 17F433851C33 for ; Tue, 6 Oct 2020 14:42:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 17F433851C33 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-489-5Jh1XGMqMlmCt6Y0Z7DUbQ-1; Tue, 06 Oct 2020 10:42:34 -0400 X-MC-Unique: 5Jh1XGMqMlmCt6Y0Z7DUbQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DA757427C4; Tue, 6 Oct 2020 14:42:33 +0000 (UTC) Received: from [10.10.118.179] (ovpn-118-179.rdu2.redhat.com [10.10.118.179]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AE0A5D9CD; Tue, 6 Oct 2020 14:42:30 +0000 (UTC) Subject: Re: [patch] convert -Wrestrict pass to ranger To: Martin Sebor , Aldy Hernandez , gcc-patches Cc: Martin Sebor References: <9a9097e5-1980-f930-5d12-b0b346c9c8e3@redhat.com> <3d94b483-6381-c0f9-aed1-cdbf99125b1e@gmail.com> From: Andrew MacLeod Message-ID: Date: Tue, 6 Oct 2020 10:42:29 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2020 14:42:38 -0000 On 10/6/20 10:30 AM, Martin Sebor wrote: > On 10/6/20 3:45 AM, Aldy Hernandez wrote: >>>> -  builtin_memref dstref (dst, dstsize); >>>> -  builtin_memref srcref (src, srcsize); >>>> +  builtin_memref dstref (query, call, dst, dstsize); >>>> +  builtin_memref srcref (query, call, src, srcsize); >>>> >>>>     /* Create a descriptor of the access.  This may adjust both DSTREF >>>>        and SRCREF based on one another and the kind of the access.  */ >>>> -  builtin_access acs (call, dstref, srcref); >>>> +  builtin_access acs (query, call, dstref, srcref); >>> >>> Since/if the query pointer is a member of builtin_memref which is >>> passed to the builtin_access ctor there should be no need to pass >>> a second (and third) copy to it as well. >> >> builtin_memref seems like an independent object altogether, and the >> query is a private member of said object.  Are you proposing making >> it public, or making builtin_access a friend of builtin_memref (eeech)? > > Either one of those seems preferable to the duplication for the time > being, until there's an API to access the global ranger instance. > > A better alternative, in view of your expectation of exposing > the instance via (cfun)->range_of_expr(), is to add some static > namespace scope function to access the range instance.  That > should make adopting the envisioned solution minimally disruptive. > The point was we don't have a fully envisioned solution yet... that is  just one possibility and may never come to pass.   Each pass should do "the right thing" for themselves for now.