From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24772 invoked by alias); 16 Jun 2011 07:36:19 -0000 Received: (qmail 24664 invoked by uid 22791); 16 Jun 2011 07:36:18 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-ww0-f51.google.com (HELO mail-ww0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Jun 2011 07:36:04 +0000 Received: by wwf26 with SMTP id 26so1108850wwf.8 for ; Thu, 16 Jun 2011 00:36:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.197.83 with SMTP id ej19mr501210wbb.105.1308209763700; Thu, 16 Jun 2011 00:36:03 -0700 (PDT) Received: by 10.227.28.69 with HTTP; Thu, 16 Jun 2011 00:36:03 -0700 (PDT) In-Reply-To: References: <4DEDB98F.6010508@redhat.com> <4DEE2DCF.7020905@redhat.com> <4DEE3484.8030101@redhat.com> <4DF11FBC.3010304@redhat.com> <4DF223D4.3080700@redhat.com> <4DF22656.9050700@redhat.com> <37B61697-B4A5-49B6-87C4-AD361A86F752@comcast.net> Date: Thu, 16 Jun 2011 07:39:00 -0000 Message-ID: Subject: Re: RFA (fold): PATCH for c++/49290 (folding *(T*)(ar+10)) From: Richard Guenther To: Mike Stump Cc: Richard Guenther , Jason Merrill , gcc-patches List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg01213.txt.bz2 On Wed, Jun 15, 2011 at 7:46 PM, Mike Stump wrote: > On Jun 15, 2011, at 2:04 AM, Richard Guenther wrote: >> This VIEW_CONVERT_EXPR looks useless - in fact useless_type_conversion_p >> will tell you that, so you can omit it. > > So, I tracked down who created it: > > tree > convert_to_vector (tree type, tree expr) > { > =A0switch (TREE_CODE (TREE_TYPE (expr))) > =A0 =A0{ > =A0 =A0case INTEGER_TYPE: > =A0 =A0case VECTOR_TYPE: > =A0 =A0 =A0if (!tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (TREE_TYP= E (expr)))) > =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0error ("can%'t convert between vector values of differ= ent size"); > =A0 =A0 =A0 =A0 =A0return error_mark_node; > =A0 =A0 =A0 =A0} > =3D> =A0 =A0return build1 (VIEW_CONVERT_EXPR, type, expr); > > If people want to not create useless conversions in the first place, thou= gh, I suspect there are lots of places that create useless conversions in t= he compiler. Yeah, the above looks it comes from the frontends - gimplification should strip this conversion, if it doesn't that is a bug ;) Richard.