From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123469 invoked by alias); 3 Nov 2015 15:08:23 -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 122694 invoked by uid 89); 3 Nov 2015 15:08:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 03 Nov 2015 15:08:22 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55504) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ZtdC7-0007Nf-QB for gcc-patches@gnu.org; Tue, 03 Nov 2015 10:08:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtdC2-0000NV-JX for gcc-patches@gnu.org; Tue, 03 Nov 2015 10:08:19 -0500 Received: from mx2.suse.de ([195.135.220.15]:55410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtdC2-0000NK-Cj for gcc-patches@gnu.org; Tue, 03 Nov 2015 10:08:14 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 800BFAC88; Tue, 3 Nov 2015 15:07:55 +0000 (UTC) Date: Tue, 03 Nov 2015 15:08:00 -0000 From: Richard Biener To: Tom de Vries cc: Richard Biener , "gcc-patches@gnu.org" Subject: Re: [PATCH, 2/2] Handle recursive restrict in function parameter In-Reply-To: <5638BAC4.3050106@mentor.com> Message-ID: References: <562E0CF5.8000606@mentor.com> <562E5381.5@mentor.com> <562F26E2.40906@mentor.com> <562F6D1A.4010001@mentor.com> <562F748D.5020507@mentor.com> <563653F5.9090302@mentor.com> <563657D0.1030203@mentor.com> <5638BAC4.3050106@mentor.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 X-SW-Source: 2015-11/txt/msg00228.txt.bz2 On Tue, 3 Nov 2015, Tom de Vries wrote: > On 01/11/15 19:20, Tom de Vries wrote: > > On 01/11/15 19:03, Tom de Vries wrote: > > > So, the new patch series is: > > > > > > 1 Rename make_restrict_var_constraints to make_param_constraints > > > 2 Handle recursive restrict in function parameter > > > > > > I'll repost in reply to this message. > > > > > > > This patch adds handling of all the restrict qualifiers in the type of a > > function parameter. > > > > And reposting an updated version, now that the toplevel parameter in > make_param_constraints has been eliminated. @@ -5195,6 +5197,8 @@ struct fieldoff unsigned may_have_pointers : 1; unsigned only_restrict_pointers : 1; + + varinfo_t restrict_var; }; store the varinfo ID here, 'unsigned int restrict_var' which ends up not changing fieldoff size. get_varinfo (restrict_var) will get you the varinfo_t. @@ -5374,6 +5380,19 @@ push_fields_onto_fieldstack (tree type, vec *fieldstack, = (!has_unknown_size && POINTER_TYPE_P (field_type) && TYPE_RESTRICT (field_type)); + if (handle_param + && e.only_restrict_pointers + && !type_contains_placeholder_p (TREE_TYPE (field_type))) + { + varinfo_t rvi; + tree heapvar = build_fake_var_decl (TREE_TYPE (field_type)); + DECL_EXTERNAL (heapvar) = 1; + rvi = create_variable_info_for_1 (heapvar, "PARM_NOALIAS", + true, true); + rvi->is_restrict_var = 1; + insert_vi_for_tree (heapvar, rvi); + e.restrict_var = rvi; + } hmm, can you delay this to the point we actually will use field-sensitive stuff? That is, until create_variable_info_for_1 decided to use a multi-field variable? Say, here: + if (handle_param + && newvi->only_restrict_pointers + && fo->restrict_var != NULL) + { + make_constraint_from (newvi, fo->restrict_var->id); + make_param_constraints (fo->restrict_var); + } ? Looks like then you don't need the new field at all. Thanks, Richard.