From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26437 invoked by alias); 9 Jun 2008 23:45:39 -0000 Received: (qmail 26429 invoked by uid 22791); 9 Jun 2008 23:45:39 -0000 X-Spam-Check-By: sourceware.org Received: from smtpout05-04.prod.mesa1.secureserver.net (HELO smtpout05.prod.mesa1.secureserver.net) (64.202.165.221) by sourceware.org (qpsmtpd/0.31) with SMTP; Mon, 09 Jun 2008 23:45:19 +0000 Received: (qmail 21674 invoked from network); 9 Jun 2008 23:45:16 -0000 Received: from unknown (24.251.96.24) by smtpout05-04.prod.mesa1.secureserver.net (64.202.165.221) with ESMTP; 09 Jun 2008 23:45:16 -0000 Message-ID: <13D82723C9864E9C93CA351786EAE74C@glap> From: "Kaveh R. Ghazi" To: "Joern Rennecke" , "Ian Lance Taylor" Cc: References: <20080609224328.GK32358@elsdt-razorfish.arc.com> Subject: Re: constified note_stores Date: Mon, 09 Jun 2008 23:45:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook Express 6.00.2900.5512 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/msg00209.txt.bz2 From: "Ian Lance Taylor" > Joern Rennecke writes: > >> I have been using note_stores to modify selected assignments. Now when I >> try to move this code to gcc 4.4, I find that I get a warning because >> my walker function takes a non-const rtx - and if I make it take a const >> rtx, >> there will be a warning somewhere inside because there is a code path >> where a SET_SRC is modified. >> data is in use to point to a libiberty hash table. >> >> So, am I supposed to ignore the warning? >> Roll my own copy of the original note_stores? >> Resurrect the original note_stores in rtlanal.c (by whatever name)? > > Use CONST_CAST_RTX where necessary. > Ian 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. Me, I prefer being const-correct, but I understand not everyone shares my enthusiasm for it. :-/ --Kaveh -- Kaveh R. Ghazi