From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30906 invoked by alias); 10 Jun 2008 13:39:01 -0000 Received: (qmail 30896 invoked by uid 22791); 10 Jun 2008 13:39:00 -0000 X-Spam-Check-By: sourceware.org Received: from SAGW-PRIMARY.ARC.COM (HELO elsdt-razorfish.arc.com) (62.189.186.51) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Jun 2008 13:38:42 +0000 Received: from elsdt-razorfish.arc.com (localhost.localdomain [127.0.0.1]) by elsdt-razorfish.arc.com (8.13.8/8.13.8) with ESMTP id m5ADcbaw017449; Tue, 10 Jun 2008 14:38:37 +0100 Received: (from joernr@localhost) by elsdt-razorfish.arc.com (8.13.8/8.13.8/Submit) id m5ADcaNJ017448; Tue, 10 Jun 2008 14:38:36 +0100 Date: Tue, 10 Jun 2008 13:39:00 -0000 From: Joern Rennecke To: "Kaveh R. Ghazi" Cc: Ian Lance Taylor , gcc@gcc.gnu.org Subject: Re: constified note_stores Message-ID: <20080610133836.GL32358@elsdt-razorfish.arc.com> References: <20080609224328.GK32358@elsdt-razorfish.arc.com> <13D82723C9864E9C93CA351786EAE74C@glap> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13D82723C9864E9C93CA351786EAE74C@glap> User-Agent: Mutt/1.4.2.2i Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2008-06/txt/msg00232.txt.bz2 > From: "Ian Lance Taylor" > >Use CONST_CAST_RTX where necessary. I think sprinkling const qualifiers liberally over the code and then casting them away whenever they get in the way is worse than having no const qualifiers in the first place. It adds extra text to the code which has no meaning, but might look to the casual observer as if it had. And it makes the code more reliant on GNU extensions. On Mon, Jun 09, 2008 at 04:45:14PM -0700, Kaveh R. Ghazi wrote: > Or pass in a struct pointer to the "data" parameter containing both your > hash table and the rtx to be modified. Pull out either member in the > walker function as necessary. That would require to delare this ad-hoc struct, put all the code in to use it, and use an asm to join the proper pointer value of the pointer to const with the un-constified pointer to the rtx root. Having another copy of note_stores seems simpler and is certainly more portable. What do you think about the name walk_stores?