From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24734 invoked by alias); 26 Oct 2009 21:44:46 -0000 Received: (qmail 24718 invoked by uid 22791); 26 Oct 2009 21:44:46 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-qy0-f171.google.com (HELO mail-qy0-f171.google.com) (209.85.221.171) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Oct 2009 21:44:39 +0000 Received: by qyk1 with SMTP id 1so10661691qyk.0 for ; Mon, 26 Oct 2009 14:44:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.124.13 with SMTP id s13mr9160867vcr.59.1256593478002; Mon, 26 Oct 2009 14:44:38 -0700 (PDT) In-Reply-To: <20091026214244.GA28136@redhat.com> References: <20091026153944.GA24939@redhat.com> <84fc9c000910260913p6457de93o6e232856677b7368@mail.gmail.com> <20091026163733.GA26251@redhat.com> <84fc9c000910260941v67686891u6d228dd918905130@mail.gmail.com> <20091026172849.GA27894@redhat.com> <84fc9c000910261346m3420a720s3a0f15d80740fdba@mail.gmail.com> <20091026214244.GA28136@redhat.com> Date: Mon, 26 Oct 2009 23:07:00 -0000 Message-ID: <84fc9c000910261444va1e34cdm1ebb291fa69ccde@mail.gmail.com> Subject: Re: RFC: allowing fold to change location of args (PR/41451) From: Richard Guenther To: Aldy Hernandez Cc: gcc@gcc.gnu.org, gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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: 2009-10/txt/msg00538.txt.bz2 On Mon, Oct 26, 2009 at 10:42 PM, Aldy Hernandez wrote: >> Certainly better. =A0But I fail to see why a different location would be >> better than the original here. =A0I assume all tokens have a correct ini= tial >> location. =A0Then why is for example for int i; =A0in (int) i the locati= on of >> the conversion a better location than the one of i in the folded result? > > I don't care either way. > > OK pending tests? Ok. Thanks, Richard. > =A0 =A0 =A0 =A0PR bootstrap/41451 > =A0 =A0 =A0 =A0* fold-const.c (fold_binary_loc): Do not call > =A0 =A0 =A0 =A0protected_set_expr_location. > > Index: fold-const.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- fold-const.c =A0 =A0 =A0 =A0(revision 153549) > +++ fold-const.c =A0 =A0 =A0 =A0(working copy) > @@ -10134,7 +10134,6 @@ fold_binary_loc (location_t loc, > =A0 =A0 =A0 =A0 =A0tem =3D fold_build2_loc (loc, code, type, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fold_convert_loc = (loc, TREE_TYPE (op0), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 TREE_OPERAND (arg0, 1)), op1); > - =A0 =A0 =A0 =A0 protected_set_expr_location (tem, loc); > =A0 =A0 =A0 =A0 =A0tem =3D build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg= 0, 0), tem); > =A0 =A0 =A0 =A0 =A0goto fold_binary_exit; > =A0 =A0 =A0 =A0} > @@ -10144,7 +10143,6 @@ fold_binary_loc (location_t loc, > =A0 =A0 =A0 =A0 =A0tem =3D fold_build2_loc (loc, code, type, op0, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fold_convert_loc = (loc, TREE_TYPE (op1), > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 TREE_OPERAND (arg1, 1))); > - =A0 =A0 =A0 =A0 protected_set_expr_location (tem, loc); > =A0 =A0 =A0 =A0 =A0tem =3D build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg= 1, 0), tem); > =A0 =A0 =A0 =A0 =A0goto fold_binary_exit; > =A0 =A0 =A0 =A0} >