From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30384 invoked by alias); 21 Jun 2007 08:48:45 -0000 Received: (qmail 30313 invoked by alias); 21 Jun 2007 08:48:34 -0000 Date: Thu, 21 Jun 2007 08:48:00 -0000 Message-ID: <20070621084834.30312.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/20623] ICE: fold check: original tree changed by fold with --enable-checking=fold In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenther at suse dot de" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-06/txt/msg01865.txt.bz2 ------- Comment #24 from rguenther at suse dot de 2007-06-21 08:48 ------- Subject: Re: ICE: fold check: original tree changed by fold with --enable-checking=fold On Thu, 21 Jun 2007, spop at gcc dot gnu dot org wrote: > > > ------- Comment #23 from spop at gcc dot gnu dot org 2007-06-21 08:21 ------- > Subject: Re: ICE: fold check: original tree changed by fold with > --enable-checking=fold > > On 6/21/07, Richard Guenther wrote: > > > > The fold_binary change looks unnecessary. > > ok. > > > The rest is ok. > > > > There was something wrong in the rest, so I'm proposing this fix instead, > as we were not using the modified base anymore for building the result 't'. > > @@ -14191,14 +14220,15 @@ build_fold_addr_expr_with_type (tree t, > } > else > { > - tree base = t; > + tree copy_t = copy_node (t); > + tree base = copy_t; > > while (handled_component_p (base)) > base = TREE_OPERAND (base, 0); > if (DECL_P (base)) > TREE_ADDRESSABLE (base) = 1; > > - t = build1 (ADDR_EXPR, ptrtype, t); > + t = build1 (ADDR_EXPR, ptrtype, copy_t); > } > > return t; Oh, indeed. The above is ok. (The fold_binary change still looks unnecessary) Richard. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20623