From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11350 invoked by alias); 26 Oct 2009 16:41:52 -0000 Received: (qmail 11340 invoked by uid 22791); 26 Oct 2009 16:41:51 -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 16:41:44 +0000 Received: by qyk1 with SMTP id 1so10450037qyk.0 for ; Mon, 26 Oct 2009 09:41:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.126.144 with SMTP id c16mr9156746vcs.43.1256575303098; Mon, 26 Oct 2009 09:41:43 -0700 (PDT) In-Reply-To: <20091026163733.GA26251@redhat.com> References: <20091026153944.GA24939@redhat.com> <84fc9c000910260913p6457de93o6e232856677b7368@mail.gmail.com> <20091026163733.GA26251@redhat.com> Date: Mon, 26 Oct 2009 17:31:00 -0000 Message-ID: <84fc9c000910260941v67686891u6d228dd918905130@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 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/msg00531.txt.bz2 On Mon, Oct 26, 2009 at 5:37 PM, Aldy Hernandez wrote: >> > ? ? ?tem =3D fold_build2_loc (loc, code, type, >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? fold_convert_loc (loc, TREE_TYPE (op0), >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? TREE_OPERAND (arg0, 1)),= op1); >> > ? ? ?protected_set_expr_location (tem, loc); >> > >> > When --enable-checking=3Dfold, fold verifies that none of the arguments >> > changed, which in this case it obviously does. >> > >> > Would be ok to allow a TREE_EXP's location to change within fold? ?Tha= t is, >> > add locus (for TREE_EXP's) to the list of allowed changeable fields in >> > fold_checksum_tree()? >> >> Why? =A0It looks like the above should already take care of the >> correct location via passing loc to fold_build2_loc. > > The correct location is being passed. =A0The problem is that in the > testcase in question, we modify the original statement (with the new > locus). =A0Modifying the original statement is a no no in > fold_checksum_tree. That wasn't my question. tem =3D fold_build2_loc (loc, code, type, fold_convert_loc (loc, TREE_TYPE (op0), TREE_OPERAND (arg0, 1)), op1); protected_set_expr_location (tem, loc); here tem is built by calling fold_build2_loc. So why is the location of tem not loc after that. This sounds like the actual bug (and the protected_set_expr_location should be redundant). Richard.