From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id F278B3858D3C for ; Wed, 16 Feb 2022 05:54:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F278B3858D3C From: Hans-Peter Nilsson To: Mike Frysinger CC: In-Reply-To: (message from Mike Frysinger on Tue, 15 Feb 2022 23:51:16 -0500) Subject: Re: [PATCH 08/12] sim cris: Unbreak --disable-sim-hardware builds MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT References: <20220214225824.AC90A20439@pchp3.se.axis.com> <20220214230512.7B80720439@pchp3.se.axis.com> Message-ID: <20220216055419.AC9A020411@pchp3.se.axis.com> Date: Wed, 16 Feb 2022 06:54:19 +0100 X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2022 05:54:22 -0000 > Date: Tue, 15 Feb 2022 23:51:16 -0500 > From: Mike Frysinger > On 15 Feb 2022 00:05, Hans-Peter Nilsson via Gdb-patches wrote: > > +#if WITH_HW > > if (cris_have_900000xxif) > > sim_hw_parse (sd, "/core/%s/reg %#x %i", "cris_900000xx", 0x90000000, 0x100); > > +#else > > + /* With the option disabled, nothing should be able to set this variable. > > + We should "use" it, though, and why not assert that it isn't set. */ > > + ASSERT (! cris_have_900000xxif); > > +#endif > > WITH_HW is always defined to either 1 or 0. could you write: > if (WITH_HW) > ... > else > ... > > this avoids bit rot in the uncommon configure paths I don't think that's a good idea, because then we'd rely on the sim_hw_parse reference go away at *all* optimization levels. brgds, H-P