From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27639 invoked by alias); 7 Jun 2011 13:46:12 -0000 Received: (qmail 27631 invoked by uid 22791); 7 Jun 2011 13:46:11 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Jun 2011 13:45:56 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id BAD0C86A2E; Tue, 7 Jun 2011 15:45:55 +0200 (CEST) Date: Tue, 07 Jun 2011 13:46:00 -0000 From: Michael Matz To: Richard Guenther Cc: Richard Guenther , Jakub Jelinek , Jason Merrill , gcc-patches List Subject: Re: RFA (fold): PATCH for c++/49290 (folding *(T*)(ar+10)) In-Reply-To: Message-ID: References: <4DEDB98F.6010508@redhat.com> <20110607102717.GZ17079@tyan-ft48-01.lab.bos.redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes 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 X-SW-Source: 2011-06/txt/msg00513.txt.bz2 Hi, On Tue, 7 Jun 2011, Richard Guenther wrote: > > > fold_convert_loc it to the expected type, while the middle-end has > > > the notion of useless type conversions, fold-const.c is also used by > > > FEs and I think it is expected to have the types exactly matching. > > > So (T)s1[10] instead of s1[10] in this case. > > > > I'm not sure that's a good idea if the caller wants an lvalue. > > Rather build the array-ref with type T directly (thus, with a mismatch > between the type of the array-ref and the element type). Ick. Sooner or later such inconsistency will bite us. It always does. Ciao, Michael.