From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from paperclip.tbsaunde.org (unknown [IPv6:2600:3c03::f03c:91ff:fe6e:c625]) by sourceware.org (Postfix) with ESMTP id 0D3BD3855020 for ; Fri, 16 Jul 2021 02:18:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0D3BD3855020 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tbsaunde.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tbsaunde.org Received: from rag (pool-108-24-42-131.cmdnnj.fios.verizon.net [108.24.42.131]) by paperclip.tbsaunde.org (Postfix) with ESMTPSA id B19A9C0E3; Fri, 16 Jul 2021 02:18:15 +0000 (UTC) Date: Thu, 15 Jul 2021 22:18:14 -0400 From: Trevor Saunders To: Richard Biener Cc: GCC Patches Subject: Re: [PATCH 1/4] force decls to be allocated through build_decl to initialize them Message-ID: References: <20210714081827.12185-1-tbsaunde@tbsaunde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_ABUSEAT, RCVD_IN_XBL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fri, 16 Jul 2021 02:18:18 -0000 On Thu, Jul 15, 2021 at 10:01:01AM +0200, Richard Biener wrote: > On Thu, Jul 15, 2021 at 4:24 AM Trevor Saunders wrote: > > > > On Wed, Jul 14, 2021 at 01:27:54PM +0200, Richard Biener wrote: > > > On Wed, Jul 14, 2021 at 10:20 AM Trevor Saunders wrote: > > > > > > > > prior to this commit all calls to build_decl used input_location, even if > > > > temporarily until build_decl reset the location to something else that it was > > > > told was the proper location. To avoid using the global we need the caller to > > > > pass in the location it wants, however that's not possible with make_node since > > > > it makes other types of nodes. So we force all callers who wish to make a decl > > > > to go through build_decl which already takes a location argument. To avoid > > > > changing behavior this just explicitly passes in input_location to build_decl > > > > for callers of make_node that create a decl, however it would seem in many of > > > > these cases that the location of the decl being coppied might be a better > > > > location. > > > > > > > > bootstrapped and regtested on x86_64-linux-gnu, ok? > > > > > > I think all eventually DECL_ARTIFICIAL decls should better use > > > UNKNOWN_LOCATION instead of input_location. > > > > You'd know if that might break something better than me, but that seems > > sensible in principal. That said, I would like to incrementally do one > > thing at a time, rather than change make_node to use unknown_location, > > and set the location to something else all at once, but I suppose I > > could first change some callers to be build_decl (unknown_location, ...) > > and then come back to changing make_node when there's fewer callers to > > reason about if that's preferable. > > Sure, we can defer changing make_node (I thought the patch catched all > but three callers ...). But it feels odd to introduce so many explicit > input_location uses for cases where it clearly doesn't matter (the > DECL_ARTIFICIAL), > so I'd prefer to "fix" those immediately, Fair enough, I think you just have more expereience and confidence it can't matter than I do yet, I'll work on fixing them immediately. Trev