This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix PR20623: ICE: fold check: original tree changed by fold with --enable-checking=fold
- From: Adam Nemet <anemet at caviumnetworks dot com>
- To: "Sebastian Pop" <sebpop at gmail dot com>
- Cc: "GCC Patches" <gcc-patches at gcc dot gnu dot org>, "Richard Guenther" <richard dot guenther at gmail dot com>
- Date: Thu, 21 Jun 2007 16:44:09 -0700
- Subject: Re: Fix PR20623: ICE: fold check: original tree changed by fold with --enable-checking=fold
- References: <cb9d34b20706211435v2e57f9c3y69c8184606266bc6@mail.gmail.com>
"Sebastian Pop" <sebpop@gmail.com> writes:
> (fold_addr_expr, debug_fold_checksum): New.
The latter should be protected with ENABLE_FOLD_CHECKING otherwise I
get this:
libbackend.a(fold-const.o)(.text+0x77c6f): In function `debug_fold_checksum':
/home/anemet/src/gcc/src/gcc/fold-const.c:12999: undefined reference to `fold_checksum_tree'
collect2: ld returned 1 exit status
I am checking this in as obvious.
Adam
* fold-const.c (debug_fold_checksum): Move it under
ENABLE_FOLD_CHECKING.
Index: fold-const.c
===================================================================
--- fold-const.c (revision 125929)
+++ fold-const.c (working copy)
@@ -12943,6 +12943,30 @@ recursive_label:
}
}
+/* Helper function for outputting the checksum of a tree T. When
+ debugging with gdb, you can "define mynext" to be "next" followed
+ by "call debug_fold_checksum (op0)", then just trace down till the
+ outputs differ. */
+
+void
+debug_fold_checksum (tree t)
+{
+ int i;
+ unsigned char checksum[16];
+ struct md5_ctx ctx;
+ htab_t ht = htab_create (32, htab_hash_pointer, htab_eq_pointer, NULL);
+
+ md5_init_ctx (&ctx);
+ fold_checksum_tree (t, &ctx, ht);
+ md5_finish_ctx (&ctx, checksum);
+ htab_empty (ht);
+
+ for (i = 0; i < 16; i++)
+ fprintf (stderr, "%d ", checksum[i]);
+
+ fprintf (stderr, "\n");
+}
+
#endif
/* Fold a unary tree expression with code CODE of type TYPE with an
@@ -12982,30 +13006,6 @@ fold_build1_stat (enum tree_code code, t
return tem;
}
-/* Helper function for outputting the checksum of a tree T. When
- debugging with gdb, you can "define mynext" to be "next" followed
- by "call debug_fold_checksum (op0)", then just trace down till the
- outputs differ. */
-
-void
-debug_fold_checksum (tree t)
-{
- int i;
- unsigned char checksum[16];
- struct md5_ctx ctx;
- htab_t ht = htab_create (32, htab_hash_pointer, htab_eq_pointer, NULL);
-
- md5_init_ctx (&ctx);
- fold_checksum_tree (t, &ctx, ht);
- md5_finish_ctx (&ctx, checksum);
- htab_empty (ht);
-
- for (i = 0; i < 16; i++)
- fprintf (stderr, "%d ", checksum[i]);
-
- fprintf (stderr, "\n");
-}
-
/* Fold a binary tree expression with code CODE of type TYPE with
operands OP0 and OP1. Return a folded expression if successful.
Otherwise, return a tree expression with code CODE of type TYPE