This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/20623] ICE: fold check: original tree changed by fold with --enable-checking=fold
- From: "spop at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Jun 2007 22:58:03 -0000
- Subject: [Bug middle-end/20623] ICE: fold check: original tree changed by fold with --enable-checking=fold
- References: <bug-20623-7559@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #17 from spop at gcc dot gnu dot org 2007-06-20 22:58 -------
Subject: Re: ICE: fold check: original tree changed by fold with
--enable-checking=fold
Hi,
The following patch fixes a part of the reported testsuite fails.
With this patch we avoid folding the TREE_CHAIN of an SSA_NAME, that
corresponds to its SSA_NAME_DEF_STMT.
Index: gcc/fold-const.c
===================================================================
--- gcc/fold-const.c (revision 125883)
+++ gcc/fold-const.c (working copy)
@@ -12775,7 +12775,8 @@ recursive_label:
fold_checksum_tree (TREE_TYPE (expr), ctx, ht);
if (TREE_CODE_CLASS (code) != tcc_type
&& TREE_CODE_CLASS (code) != tcc_declaration
- && code != TREE_LIST)
+ && code != TREE_LIST
+ && code != SSA_NAME)
fold_checksum_tree (TREE_CHAIN (expr), ctx, ht);
switch (TREE_CODE_CLASS (code))
{
The only fails that remain when compiling with default languages and
--enable-checking=assert,fold,gc,misc,rtl,rtlflag,runtime,tree
on i686-linux are:
gcc.c-torture/compile/20021108-1.c
gcc.c-torture/compile/920501-7.c
gcc.c-torture/compile/labels-1.c
gcc.c-torture/compile/labels-2.c
gcc.c-torture/compile/labels-3.c
gcc.c-torture/execute/comp-goto-1.c
gcc.dg/20021029-1.c
gcc.dg/pr16973.c
Okay for trunk?
Sebastian
PS: The remaining tests all fail when fold_build2 is passed an
ADDR_EXPR with a MINUS_EXPR.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20623