This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Bug middle-end/20623] 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]